SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Creating a Custom Site
Definition for Microsoft
Windows SharePoint
Services
Table of Contents
Creating a Custom Site Definition for Microsoft Windows SharePoint Services ..... 1
Exercise 1 Creating a Windows SharePoint Services Site Definition .................................................................2
Exercise 2 Modifying the Menu Bar for a SharePoint Site....................................................................................5
Exercise 3 Adding Custom Client-side Script Commands....................................................................................6
Exercise 4 Create a New Site Based on the Custom Definition ..........................................................................9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services


Creating a Custom Site Definition for
Microsoft Windows SharePoint Services
                                 After competing this lab, you will be able to:
Objectives                            Create a Windows SharePoint Services site definition
                                      Modify the site's menu bar
                                      Add custom commands to the user interface
                                      Create a new site based on the custom site definition
                                 The purpose of this lab is to learn how to create a new Windows SharePoint
Scenario                         Services site definition, and how to customize specific appearances and
                                 behaviors for sites created using this new site definition.

Estimated Time to                60 Minutes
Complete This Lab




                                                  Page 1 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services



Exercise 1
Creating a Windows SharePoint Services Site Definition

Scenario
In this exercise, you will learn how to create a new global site definition. The easiest, most reliable way to
do so is to copy an existing site definition and edit it.


Tasks                                Detailed Steps
1. Connect to the                    a. Click inside the virtual machine window.
    virtual machine                  b. Press Right-ALT + DEL.
                                     c. Logon as Administrator to the CONTOSO domain with the password
                                        pass@word1.
2. Copy the default                  a. Double click the Jeff Teper.RDP remote desktop connection on the desktop.
    definition                       b. Enter the password pass@word1 if promoted. The Warm Up Demo script will
                                        run. This will take a few minutes. Please wait for it to finish and close.
                                     c. Minimize Internet Explorer. If the Contoso SharePoint page does not load up,
                                        click the Home icon, then minimize.
                                     d. On the desktop, double click My Computer and navigate to C:Program
                                        FilesCommon FilesMicrosoft Sharedweb server
                                        extensions60TEMPLATE1033.
                                     e. Right-click the STS directory and click Copy.
                                     f. Click Edit | Paste.
                                     g. Right click on the Copy of STS directory and click Rename. Type FOO to
                                        rename the directory and click in the white space in the folder.
3. Copy the definition               a.   Double-click the XML directory to open it.
    instruction file                 b.   Right click on the WEBTEMP.XML file and click Copy.
                                     c.   Click Edit | Paste.
                                     d.   Right click on the Copy of WEBTEMP.XML file and select Rename. Type
                                          WEBTEMPFOO.XML to rename the file.
4. Edit the definition               a. Right-click the WEBTEMPFOO.XML file and choose Edit with Visual Studio
    file                                .NET 2003.
The WEBTEMP.XML file                 b. Highlight the following text (the MPS template section) and press DELETE:
contains references to all of the
standard site definitions included        <Template Name=quot;MPSquot;     ID=quot;2quot; >
with Windows SharePoint                       <Configuration ID=quot;0quot; Title=quot;Basic Meeting Workspacequot;
Services. We only need to keep            Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot;
one of the entries in                     Description=quot;All the basics to plan, organize and track
WEBTEMPFOO.XML, so the                    your meeting. This Meeting Workspace contains the
rest of the entries need to be            following lists: Objectives, Attendees, Agenda, and
removed.
                                          Document Library.quot;>   </Configuration>
                                              <Configuration ID=quot;1quot; Title=quot;Blank Meeting Workspacequot;
                                          Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot;
                                          Description=quot;A blank Meeting Workspace for you to
                                          customize based on your requirements.quot;>   </Configuration>
                                              <Configuration ID=quot;2quot; Title=quot;Decision Meeting



                                                          Page 2 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services
Tasks                       Detailed Steps
                               Workspacequot; Hidden=quot;FALSEquot;
                               ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;A
                               Meeting Workspace in which to review relevant documents
                               and record decisions. This Meeting Workspace contains the
                               following lists: Objectives, Attendees, Agenda, Document
                               Library, Tasks, and Decisions.quot;>   </Configuration>
                                   <Configuration ID=quot;3quot; Title=quot;Social Meeting Workspacequot;
                               Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot;
                               Description=quot;A planning tool for social occasions,
                               featuring a discussion board and a picture library to post
                               pictures of the event. This Meeting Workspace contains the
                               following lists and Web Parts: Attendees, Directions,
                               Image/Logo, Things To Bring, Discussions, and Picture
                               Library.quot;>   </Configuration>
                                   <Configuration ID=quot;4quot; Title=quot;Multipage Meeting
                               Workspacequot; Hidden=quot;FALSEquot;
                               ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;All
                               the basics to plan, organize and track your meeting with
                               multiple pages. This Meeting Workspace contains the
                               following lists: Objectives, Attendees and Agenda in
                               addition to two blank pages for you to customize based on
                               your requirements.quot;>   </Configuration>
                                </Template>
                            c. Highlight the line that begins with the following text and press DELETE:
                               <Configuration ID=quot;1quot; Title=quot;Blank Sitequot;
                            d. Highlight the line that begins with the following text and press DELETE:
                               <Configuration ID=quot;2quot; Title=quot;Document Workspacequot;
                            e. Find the following line of text, highlight the name STS and press DELETE:
                               <Template Name=quot;STSquot;              ID=quot;1quot;>
                            f. In its place, type FOO (the same name as you gave the directory you created
                               above).
                            g. In the same line of text, highlight the numeral 1 and press DELETE:
                            h. In its place, type the number 97.
                            i. Find the configuration line that begins with the following text:
                               <Configuration ID=quot;0quot; Title=quot;Team Sitequot;
                            j. Highlight the word Team Site and press DELETE. In its place, type FOO Site
                            k. The file should now look like this:
                               <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
                               <!-- _lcid=quot;1033quot; _version=quot;11.0.5510quot; _dal=quot;1quot; -->
                               <!-- _LocalBinding -->
                               <Templates xmlns:ows=quot;Microsoft SharePointquot;>
                                <Template Name=quot;FOOquot;     ID=quot;97quot;>
                                   <Configuration ID=quot;0quot; Title=quot;Team Sitequot; Hidden=quot;FALSEquot;
                               ImageUrl=quot;/_layouts/images/stsprev.pngquot; Description=quot;This
                               template creates a site for teams to create, organize, and
                               share information quickly and easily. It includes a
                               Document Library, and basic lists such as Announcements,
                               Events, Contacts, and Quick Links.quot;>    </Configuration>
                                </Template>
                               </Templates>
                            l. Click File | Save All.


                                                  Page 3 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services
Tasks                       Detailed Steps
                            m. Click File | Exit.
5. Restart IIS              a. Click Start | Run.
                            b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the
                               popup window to close.




                                                    Page 4 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services

Exercise 2
Modifying the Menu Bar for a SharePoint Site

Scenario
In this exercise, you will learn how to modify the menu bar (the HTML menu that appears at the top of all pages) for
sites created from a your new custom site definition.


Tasks                        Detailed Steps
6. Open the site             a. In Windows file explorer, navigate to C:Program FilesCommon
   definition file              FilesMicrosoft Sharedweb server
                                extensions60TEMPLATE1033FOOXML.
                             b. Right-click the file ONET.XML and click Edit with Visual Studio .NET 2003.
7. Add a link to My          a. Locate the NavBars section in the ONET.XML file. It begins with the following
   Site                         text:
                                 <NavBars>
                             b. Locate the NavBar named SharePoint Top Navbar. It is the line that begins with
                                the following text:
                                 <NavBar Name=quot;SharePoint Top Navbarquot;
                             c. On a new blank line beneath the line you just located, create a new node in the
                                SharePoint Top Navbar by typing the following text:
                                 <NavBarLink Name=quot;My Sitequot; Url=quot;/MySitequot;>                 </NavBarLink>
                             d. Click File | Save All.
8. Restart IIS               a. Click Start | Run.
                             b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the
                                popup window to close.




                                                    Page 5 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services

Exercise 3
Adding Custom Client-side Script Commands

Scenario
In this exercise, you will learn how to configure custom client side scripts for the item menu. This setting is applied
at site creation time, so you will not modify the behavior of existing sites.


Tasks                                   Detailed Steps
9. Add the                              a. In Visual Studio, find the Project element that begins with the following text:
    CustomJSUrl                            <Project Title=quot;Team Web Sitequot;
    parameter to new                    b. Place the cursor at the end of the element, immediately before the final > and press
    sites                                  SPACEBAR.
                                        c. Type the following text in a single line to add an attribute to the node:
                                           CustomJSUrl=quot;/_layouts/[%=System.Threading.Thread.CurrentT
                                           hread.CurrentUICulture.LCID%]/new_ows.jsquot;
                                        d. When you are done, the full line should look something like this:
                                           <Project Title=quot;Team Web Sitequot; ListDir=quot;Listsquot;
                                           xmlns:ows=quot;Microsoft SharePointquot; CustomJSUrl=quot;/_layouts/
                                           [%=System.Threading.Thread.CurrentThread.CurrentUICulture.
                                           LCID%]/new_ows.jsquot;>
                                        e. Click File | Save All.
                                        f. Click File | Exit.
10. Restart IIS                         a. Click Start | Run.
                                        b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the
                                           popup window to close.
11. Create the                          a. Return to the file explorer and navigate to C:Program FilesCommon
    new_ows.js file                        FilesMicrosoft Sharedweb server
The command list for a                     extensions60TEMPLATELAYOUTS1033.
document in a document library          b. Click File | New | Text Document.
is populated with custom JScript
commands. You just instructed           c. Type new_ows.js and press ENTER. Click Yes when prompted.
the site definition to have all sites   d. Right-click on the newly-created new_ows.js file and click Edit with Visual
created based on it reference an           Studio .NET 2003.
additional JScript file named
new_ows.js.                             e. Add the following JScript code to the file:
This file need s to be created,            function AddCheckinCheckoutMenuItem(m, ctx, url)
and it must contain functions to           {
manipulate the command list and               if (currentItemCheckedOutUserId == null)
to react to the user choosing the
                                              {
new custom command.
                                                  currentItemCheckedOutUserId = itemTable.COUId;
The command we will add will
                                              }
pass the filename to a new
ASP.NET page that checks out a                if (currentItemCheckedOutUserId != quot;quot;)
file and immediately issues a                 {
HTTP GET that downloads it to                     strDisplayText = L_Checkin_Text;
the user's local PC.                              strAction = quot;NavigateToCheckinAspx('quot; + ctx.HttpRoot
                                           + quot;', 'FileName=quot; + url + quot;')quot;;
                                                  strImagePath = ctx.imagesPath + quot;checkin.gifquot;;
                                                  CAMOpt(m, strDisplayText, strAction, strImagePath);
                                              }


                                                              Page 6 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services
Tasks                                Detailed Steps
                                           else
                                           {
                                               strDisplayText = L_Checkout_Text;
                                               strAction = quot;NavigateToCheckinAspx('quot; + ctx.HttpRoot
                                        + quot;', 'FileName=quot; + url + quot;&Checkout=true')quot;;
                                               strImagePath = ctx.imagesPath + quot;checkout.gifquot;;
                                               CAMOpt(m, strDisplayText, strAction, strImagePath);
                                               if (ctx.listTemplate == 101)
                                               {
                                                   strAction = quot;CheckOutAndDownload('quot; +
                                        ctx.HttpRoot + quot;', 'FileName=quot; + url + quot;&Checkout=true')quot;;
                                                   CAMOpt(m, quot;Check Out & Downloadquot;, strAction,
                                        strImagePath);
                                                   CAMSep(m);
                                               }
                                           }
                                        }

                                        function CheckOutAndDownload(strHttpRoot, strArgs)
                                        {
                                           window.onfocus = RefreshOnNextFocus;
                                           SubmitFormPost(strHttpRoot + quot;/_layouts/quot; +
                                        L_Language_Text + quot;/CheckOutAndDownload.aspx?quot; + strArgs +
                                        quot;&Source=quot; + GetSource());
                                        }
                                     f. Click File | Save All.
                                     g. Click File | Exit.
12. Create the ASPX                  a. In Windows file explorer, navigate to C:Program FilesCommon
    page used by the                    FilesMicrosoft Sharedweb server
    custom Check Out                    extensions60TEMPLATELAYOUTS1033.
    and Download                     b. Click File | New | Text Document.
    function
                                     c. Type CheckOutAndDownload.aspx and press ENTER. Click Yes when
The custom JScript function             prompted.
CheckOutAndDownload will
send the user's browser to an        d. Double-click on the CheckOutAndDownload.aspx file to open it for editing in
ASP.NET page named                      Visual Studio .NET.
CheckOutAndDownload.aspx. It
                                     e. Add the following code to the file:
will pass the document's URL as
a parameter so the page can do          <%@ Page language=quot;C#quot; EnableViewStateMac=quot;falsequot; %>
two things that normally involve        <%@ Register Tagprefix=quot;SharePointquot;
separate steps in Windows               Namespace=quot;Microsoft.SharePoint.WebControlsquot;
SharePoint Services, checking           Assembly=quot;Microsoft.SharePoint, Version=11.0.0.0,
out the file and downloading it to
one's local computer.                   Culture=neutral, PublicKeyToken=71e9bce111e9429cquot; %>
                                        <%@ Import Namespace=quot;Microsoft.SharePointquot; %>
The ASP.NET file's code will, if
the document is available for
checkout, check out the file            <script runat=quot;serverquot;>
using the Windows SharePoint            void Page_Load()
Services object model, and then         {
send it down to the user via the           SPWeb web = SPControl.GetContextWeb(Context);
ASP.NET Response object. To                string strPath = Request.QueryString[quot;FileNamequot;];
ensure that the document is
saved locally rather than simple           SPFile file=web.GetFile(strPath);
being opened, the download will
be marked as a simple octet                if ((file.Exists) && (file.CheckOutStatus ==
stream rather than as a specific        Microsoft.SharePoint.SPFile.SPCheckOutStatus.None))


                                                           Page 7 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services
Tasks                            Detailed Steps
document format for which an            {
application may be registered.             Response.Clear();
                                           file.CheckOut();
                                           Response.AddHeader(quot;Content-Dispositionquot;,
                                    quot;attachment; filename=quot; + file.Name);
                                           Response.AddHeader (quot;Content-Lengthquot;,
                                    file.Length.ToString());
                                           Response.ContentType = quot;application/octet-streamquot;;
                                           Response.BinaryWrite(file.OpenBinary());
                                       }
                                       else
                                       {
                                           Response.Write(quot;The file does not existquot; + quot; or is
                                    already checked out.quot;);
                                       }
                                    }
                                    </script>
                                 f. Click File | Save All.
                                 g. Click File | Exit.




                                                       Page 8 of 9
Creating a Custom Site Definition for Microsoft Windows SharePoint Services

Exercise 4
Create a New Site Based on the Custom Definition

Scenario
In this exercise, you will create a new site with your changes.


Tasks                         Detailed Steps
1. Create a new site          a. Maximize Internet Explorer.
                              b.   In the top navigation bar, click Sites.
                              c.   In the left navigation bar, under Actions, click Create Site.
                              d.   In the Title field, type New FOO Site.
                              e.   In the URL name field, type FOO.
                              f.   Click Create.
                              g.   Click OK.
                              h.   Select the FOO Site template you just created and click OK.
                              i.   Explore the site. Notice the My Site link in the top navigation bar.
2. Test the menu              a. Return to the home page of the site you just created.
                              b. In the left navigation bar, click Shared Documents.
                              c. In the toolbar, click Upload Document.
                              d. Click Browse.
                              e. Navigate to C:Sales Fileshare, select Annual Report.doc and click Open.
                              f. Click Save and Close.
                              g. Once the document has been uploaded, let your mouse pointer hover over the
                                 uploaded document on the Shared Documents page. When the command list menu
                                 appears, click on the down arrow to display the list of possible commands.
                              h. Select the Check Out command.
                              i. Select the Edit in Microsoft Office Word command. The document will open in
                                 a new instance of Word.
                              j. Click Ok to open the document.




                                                      Page 9 of 9

Contenu connexe

Similaire à Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20 Share Point%20 Services

Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
LiquidHub
 
Organizingand Finding Resourceswith Office Share Point Server2007
Organizingand Finding Resourceswith Office Share Point Server2007Organizingand Finding Resourceswith Office Share Point Server2007
Organizingand Finding Resourceswith Office Share Point Server2007
LiquidHub
 
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 RefreshOrganizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
LiquidHub
 
Advanced SEO for Web Developers
Advanced SEO for Web DevelopersAdvanced SEO for Web Developers
Advanced SEO for Web Developers
Nathan Buggia
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
Suite Solutions
 
Office Share Point Server2007 Functionaland Architectural Overview
Office Share Point Server2007 Functionaland Architectural OverviewOffice Share Point Server2007 Functionaland Architectural Overview
Office Share Point Server2007 Functionaland Architectural Overview
LiquidHub
 
Tulsa Tech Fest - SharePoint 2013 Lessons Learned
Tulsa Tech Fest - SharePoint 2013 Lessons LearnedTulsa Tech Fest - SharePoint 2013 Lessons Learned
Tulsa Tech Fest - SharePoint 2013 Lessons Learned
April Dunnam
 

Similaire à Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20 Share Point%20 Services (20)

Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20...
 
BP210 XPages: Enter The Dojo
BP210 XPages: Enter The DojoBP210 XPages: Enter The Dojo
BP210 XPages: Enter The Dojo
 
Organizingand Finding Resourceswith Office Share Point Server2007
Organizingand Finding Resourceswith Office Share Point Server2007Organizingand Finding Resourceswith Office Share Point Server2007
Organizingand Finding Resourceswith Office Share Point Server2007
 
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 RefreshOrganizingand Finding Resourceswith Office Share Point Server2007 Refresh
Organizingand Finding Resourceswith Office Share Point Server2007 Refresh
 
The Dojo Build System
The Dojo Build SystemThe Dojo Build System
The Dojo Build System
 
Extending the GFv3 Admin Console
Extending the GFv3 Admin ConsoleExtending the GFv3 Admin Console
Extending the GFv3 Admin Console
 
Auslug 2011 customising ibm connections
Auslug 2011 customising ibm connectionsAuslug 2011 customising ibm connections
Auslug 2011 customising ibm connections
 
Advanced SEO for Web Developers
Advanced SEO for Web DevelopersAdvanced SEO for Web Developers
Advanced SEO for Web Developers
 
Getting More Traffic From Search Advanced Seo For Developers Presentation
Getting More Traffic From Search  Advanced Seo For Developers PresentationGetting More Traffic From Search  Advanced Seo For Developers Presentation
Getting More Traffic From Search Advanced Seo For Developers Presentation
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Leveraging Continuous Integration For Fun And Profit!
Leveraging Continuous Integration For Fun And Profit!Leveraging Continuous Integration For Fun And Profit!
Leveraging Continuous Integration For Fun And Profit!
 
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
BP304 - Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Introduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePointIntroduction To Developing Custom Actions Within SharePoint
Introduction To Developing Custom Actions Within SharePoint
 
Debugging and Error handling
Debugging and Error handlingDebugging and Error handling
Debugging and Error handling
 
Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304
 
Office Share Point Server2007 Functionaland Architectural Overview
Office Share Point Server2007 Functionaland Architectural OverviewOffice Share Point Server2007 Functionaland Architectural Overview
Office Share Point Server2007 Functionaland Architectural Overview
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
Tulsa Tech Fest - SharePoint 2013 Lessons Learned
Tulsa Tech Fest - SharePoint 2013 Lessons LearnedTulsa Tech Fest - SharePoint 2013 Lessons Learned
Tulsa Tech Fest - SharePoint 2013 Lessons Learned
 
Salesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command lineSalesforce Admin's guide : the data loader from the command line
Salesforce Admin's guide : the data loader from the command line
 

Plus de LiquidHub

Sharepoint 2013 upgrade process
Sharepoint 2013 upgrade processSharepoint 2013 upgrade process
Sharepoint 2013 upgrade process
LiquidHub
 
Share point 2013
Share point 2013Share point 2013
Share point 2013
LiquidHub
 
Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovements
LiquidHub
 
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
LiquidHub
 
Managing metadata in_share_point_2010
Managing metadata in_share_point_2010Managing metadata in_share_point_2010
Managing metadata in_share_point_2010
LiquidHub
 
Fast search for share point
Fast search for share pointFast search for share point
Fast search for share point
LiquidHub
 
Simple Farm Server Deployment
Simple Farm Server DeploymentSimple Farm Server Deployment
Simple Farm Server Deployment
LiquidHub
 
Pre Install Databases
Pre Install DatabasesPre Install Databases
Pre Install Databases
LiquidHub
 
Moss 2007 Deployment Detail
Moss 2007 Deployment DetailMoss 2007 Deployment Detail
Moss 2007 Deployment Detail
LiquidHub
 
Moss 2007 Backup Strategies
Moss 2007 Backup StrategiesMoss 2007 Backup Strategies
Moss 2007 Backup Strategies
LiquidHub
 
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
LiquidHub
 
5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps
LiquidHub
 
Working With Infopath 2007
Working With Infopath 2007Working With Infopath 2007
Working With Infopath 2007
LiquidHub
 
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature WalkthroughWhats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
LiquidHub
 
Overviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshOverviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components Refresh
LiquidHub
 
Office2007 Overview Express
Office2007 Overview ExpressOffice2007 Overview Express
Office2007 Overview Express
LiquidHub
 

Plus de LiquidHub (20)

Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0Share point 2013 coding standards and best practices 1.0
Share point 2013 coding standards and best practices 1.0
 
Sharepoint 2013 upgrade process
Sharepoint 2013 upgrade processSharepoint 2013 upgrade process
Sharepoint 2013 upgrade process
 
Share point 2013
Share point 2013Share point 2013
Share point 2013
 
Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovements
 
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
Microsoft office-sharepoint-server-2007-presentation-120211522467022-2
 
Managing metadata in_share_point_2010
Managing metadata in_share_point_2010Managing metadata in_share_point_2010
Managing metadata in_share_point_2010
 
Fast search for share point
Fast search for share pointFast search for share point
Fast search for share point
 
Simple Farm Server Deployment
Simple Farm Server DeploymentSimple Farm Server Deployment
Simple Farm Server Deployment
 
Pre Install Databases
Pre Install DatabasesPre Install Databases
Pre Install Databases
 
Moss 2007 Deployment Detail
Moss 2007 Deployment DetailMoss 2007 Deployment Detail
Moss 2007 Deployment Detail
 
Moss 2007 Backup Strategies
Moss 2007 Backup StrategiesMoss 2007 Backup Strategies
Moss 2007 Backup Strategies
 
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
How To Configure Email Enabled Lists In Moss2007 Rtm Using Exchange 2003
 
Bdc Screens
Bdc ScreensBdc Screens
Bdc Screens
 
Bdc Screens
Bdc ScreensBdc Screens
Bdc Screens
 
5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps
 
5060 A 01
5060 A 015060 A 01
5060 A 01
 
Working With Infopath 2007
Working With Infopath 2007Working With Infopath 2007
Working With Infopath 2007
 
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature WalkthroughWhats New In Microsoft Windows Share Point Services Feature Walkthrough
Whats New In Microsoft Windows Share Point Services Feature Walkthrough
 
Overviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshOverviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components Refresh
 
Office2007 Overview Express
Office2007 Overview ExpressOffice2007 Overview Express
Office2007 Overview Express
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Creating%20a%20 Custom%20 Site%20 Definition%20for%20 Microsoft%20 Windows%20 Share Point%20 Services

  • 1. Creating a Custom Site Definition for Microsoft Windows SharePoint Services
  • 2. Table of Contents Creating a Custom Site Definition for Microsoft Windows SharePoint Services ..... 1 Exercise 1 Creating a Windows SharePoint Services Site Definition .................................................................2 Exercise 2 Modifying the Menu Bar for a SharePoint Site....................................................................................5 Exercise 3 Adding Custom Client-side Script Commands....................................................................................6 Exercise 4 Create a New Site Based on the Custom Definition ..........................................................................9
  • 3. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Creating a Custom Site Definition for Microsoft Windows SharePoint Services After competing this lab, you will be able to: Objectives Create a Windows SharePoint Services site definition Modify the site's menu bar Add custom commands to the user interface Create a new site based on the custom site definition The purpose of this lab is to learn how to create a new Windows SharePoint Scenario Services site definition, and how to customize specific appearances and behaviors for sites created using this new site definition. Estimated Time to 60 Minutes Complete This Lab Page 1 of 9
  • 4. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Exercise 1 Creating a Windows SharePoint Services Site Definition Scenario In this exercise, you will learn how to create a new global site definition. The easiest, most reliable way to do so is to copy an existing site definition and edit it. Tasks Detailed Steps 1. Connect to the a. Click inside the virtual machine window. virtual machine b. Press Right-ALT + DEL. c. Logon as Administrator to the CONTOSO domain with the password pass@word1. 2. Copy the default a. Double click the Jeff Teper.RDP remote desktop connection on the desktop. definition b. Enter the password pass@word1 if promoted. The Warm Up Demo script will run. This will take a few minutes. Please wait for it to finish and close. c. Minimize Internet Explorer. If the Contoso SharePoint page does not load up, click the Home icon, then minimize. d. On the desktop, double click My Computer and navigate to C:Program FilesCommon FilesMicrosoft Sharedweb server extensions60TEMPLATE1033. e. Right-click the STS directory and click Copy. f. Click Edit | Paste. g. Right click on the Copy of STS directory and click Rename. Type FOO to rename the directory and click in the white space in the folder. 3. Copy the definition a. Double-click the XML directory to open it. instruction file b. Right click on the WEBTEMP.XML file and click Copy. c. Click Edit | Paste. d. Right click on the Copy of WEBTEMP.XML file and select Rename. Type WEBTEMPFOO.XML to rename the file. 4. Edit the definition a. Right-click the WEBTEMPFOO.XML file and choose Edit with Visual Studio file .NET 2003. The WEBTEMP.XML file b. Highlight the following text (the MPS template section) and press DELETE: contains references to all of the standard site definitions included <Template Name=quot;MPSquot; ID=quot;2quot; > with Windows SharePoint <Configuration ID=quot;0quot; Title=quot;Basic Meeting Workspacequot; Services. We only need to keep Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot; one of the entries in Description=quot;All the basics to plan, organize and track WEBTEMPFOO.XML, so the your meeting. This Meeting Workspace contains the rest of the entries need to be following lists: Objectives, Attendees, Agenda, and removed. Document Library.quot;> </Configuration> <Configuration ID=quot;1quot; Title=quot;Blank Meeting Workspacequot; Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;A blank Meeting Workspace for you to customize based on your requirements.quot;> </Configuration> <Configuration ID=quot;2quot; Title=quot;Decision Meeting Page 2 of 9
  • 5. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Tasks Detailed Steps Workspacequot; Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;A Meeting Workspace in which to review relevant documents and record decisions. This Meeting Workspace contains the following lists: Objectives, Attendees, Agenda, Document Library, Tasks, and Decisions.quot;> </Configuration> <Configuration ID=quot;3quot; Title=quot;Social Meeting Workspacequot; Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;A planning tool for social occasions, featuring a discussion board and a picture library to post pictures of the event. This Meeting Workspace contains the following lists and Web Parts: Attendees, Directions, Image/Logo, Things To Bring, Discussions, and Picture Library.quot;> </Configuration> <Configuration ID=quot;4quot; Title=quot;Multipage Meeting Workspacequot; Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/mwsprev.pngquot; Description=quot;All the basics to plan, organize and track your meeting with multiple pages. This Meeting Workspace contains the following lists: Objectives, Attendees and Agenda in addition to two blank pages for you to customize based on your requirements.quot;> </Configuration> </Template> c. Highlight the line that begins with the following text and press DELETE: <Configuration ID=quot;1quot; Title=quot;Blank Sitequot; d. Highlight the line that begins with the following text and press DELETE: <Configuration ID=quot;2quot; Title=quot;Document Workspacequot; e. Find the following line of text, highlight the name STS and press DELETE: <Template Name=quot;STSquot; ID=quot;1quot;> f. In its place, type FOO (the same name as you gave the directory you created above). g. In the same line of text, highlight the numeral 1 and press DELETE: h. In its place, type the number 97. i. Find the configuration line that begins with the following text: <Configuration ID=quot;0quot; Title=quot;Team Sitequot; j. Highlight the word Team Site and press DELETE. In its place, type FOO Site k. The file should now look like this: <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;11.0.5510quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Templates xmlns:ows=quot;Microsoft SharePointquot;> <Template Name=quot;FOOquot; ID=quot;97quot;> <Configuration ID=quot;0quot; Title=quot;Team Sitequot; Hidden=quot;FALSEquot; ImageUrl=quot;/_layouts/images/stsprev.pngquot; Description=quot;This template creates a site for teams to create, organize, and share information quickly and easily. It includes a Document Library, and basic lists such as Announcements, Events, Contacts, and Quick Links.quot;> </Configuration> </Template> </Templates> l. Click File | Save All. Page 3 of 9
  • 6. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Tasks Detailed Steps m. Click File | Exit. 5. Restart IIS a. Click Start | Run. b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the popup window to close. Page 4 of 9
  • 7. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Exercise 2 Modifying the Menu Bar for a SharePoint Site Scenario In this exercise, you will learn how to modify the menu bar (the HTML menu that appears at the top of all pages) for sites created from a your new custom site definition. Tasks Detailed Steps 6. Open the site a. In Windows file explorer, navigate to C:Program FilesCommon definition file FilesMicrosoft Sharedweb server extensions60TEMPLATE1033FOOXML. b. Right-click the file ONET.XML and click Edit with Visual Studio .NET 2003. 7. Add a link to My a. Locate the NavBars section in the ONET.XML file. It begins with the following Site text: <NavBars> b. Locate the NavBar named SharePoint Top Navbar. It is the line that begins with the following text: <NavBar Name=quot;SharePoint Top Navbarquot; c. On a new blank line beneath the line you just located, create a new node in the SharePoint Top Navbar by typing the following text: <NavBarLink Name=quot;My Sitequot; Url=quot;/MySitequot;> </NavBarLink> d. Click File | Save All. 8. Restart IIS a. Click Start | Run. b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the popup window to close. Page 5 of 9
  • 8. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Exercise 3 Adding Custom Client-side Script Commands Scenario In this exercise, you will learn how to configure custom client side scripts for the item menu. This setting is applied at site creation time, so you will not modify the behavior of existing sites. Tasks Detailed Steps 9. Add the a. In Visual Studio, find the Project element that begins with the following text: CustomJSUrl <Project Title=quot;Team Web Sitequot; parameter to new b. Place the cursor at the end of the element, immediately before the final > and press sites SPACEBAR. c. Type the following text in a single line to add an attribute to the node: CustomJSUrl=quot;/_layouts/[%=System.Threading.Thread.CurrentT hread.CurrentUICulture.LCID%]/new_ows.jsquot; d. When you are done, the full line should look something like this: <Project Title=quot;Team Web Sitequot; ListDir=quot;Listsquot; xmlns:ows=quot;Microsoft SharePointquot; CustomJSUrl=quot;/_layouts/ [%=System.Threading.Thread.CurrentThread.CurrentUICulture. LCID%]/new_ows.jsquot;> e. Click File | Save All. f. Click File | Exit. 10. Restart IIS a. Click Start | Run. b. In the Run dialog, type IISRESET /timeout:120 and press ENTER. Wait for the popup window to close. 11. Create the a. Return to the file explorer and navigate to C:Program FilesCommon new_ows.js file FilesMicrosoft Sharedweb server The command list for a extensions60TEMPLATELAYOUTS1033. document in a document library b. Click File | New | Text Document. is populated with custom JScript commands. You just instructed c. Type new_ows.js and press ENTER. Click Yes when prompted. the site definition to have all sites d. Right-click on the newly-created new_ows.js file and click Edit with Visual created based on it reference an Studio .NET 2003. additional JScript file named new_ows.js. e. Add the following JScript code to the file: This file need s to be created, function AddCheckinCheckoutMenuItem(m, ctx, url) and it must contain functions to { manipulate the command list and if (currentItemCheckedOutUserId == null) to react to the user choosing the { new custom command. currentItemCheckedOutUserId = itemTable.COUId; The command we will add will } pass the filename to a new ASP.NET page that checks out a if (currentItemCheckedOutUserId != quot;quot;) file and immediately issues a { HTTP GET that downloads it to strDisplayText = L_Checkin_Text; the user's local PC. strAction = quot;NavigateToCheckinAspx('quot; + ctx.HttpRoot + quot;', 'FileName=quot; + url + quot;')quot;; strImagePath = ctx.imagesPath + quot;checkin.gifquot;; CAMOpt(m, strDisplayText, strAction, strImagePath); } Page 6 of 9
  • 9. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Tasks Detailed Steps else { strDisplayText = L_Checkout_Text; strAction = quot;NavigateToCheckinAspx('quot; + ctx.HttpRoot + quot;', 'FileName=quot; + url + quot;&Checkout=true')quot;; strImagePath = ctx.imagesPath + quot;checkout.gifquot;; CAMOpt(m, strDisplayText, strAction, strImagePath); if (ctx.listTemplate == 101) { strAction = quot;CheckOutAndDownload('quot; + ctx.HttpRoot + quot;', 'FileName=quot; + url + quot;&Checkout=true')quot;; CAMOpt(m, quot;Check Out & Downloadquot;, strAction, strImagePath); CAMSep(m); } } } function CheckOutAndDownload(strHttpRoot, strArgs) { window.onfocus = RefreshOnNextFocus; SubmitFormPost(strHttpRoot + quot;/_layouts/quot; + L_Language_Text + quot;/CheckOutAndDownload.aspx?quot; + strArgs + quot;&Source=quot; + GetSource()); } f. Click File | Save All. g. Click File | Exit. 12. Create the ASPX a. In Windows file explorer, navigate to C:Program FilesCommon page used by the FilesMicrosoft Sharedweb server custom Check Out extensions60TEMPLATELAYOUTS1033. and Download b. Click File | New | Text Document. function c. Type CheckOutAndDownload.aspx and press ENTER. Click Yes when The custom JScript function prompted. CheckOutAndDownload will send the user's browser to an d. Double-click on the CheckOutAndDownload.aspx file to open it for editing in ASP.NET page named Visual Studio .NET. CheckOutAndDownload.aspx. It e. Add the following code to the file: will pass the document's URL as a parameter so the page can do <%@ Page language=quot;C#quot; EnableViewStateMac=quot;falsequot; %> two things that normally involve <%@ Register Tagprefix=quot;SharePointquot; separate steps in Windows Namespace=quot;Microsoft.SharePoint.WebControlsquot; SharePoint Services, checking Assembly=quot;Microsoft.SharePoint, Version=11.0.0.0, out the file and downloading it to one's local computer. Culture=neutral, PublicKeyToken=71e9bce111e9429cquot; %> <%@ Import Namespace=quot;Microsoft.SharePointquot; %> The ASP.NET file's code will, if the document is available for checkout, check out the file <script runat=quot;serverquot;> using the Windows SharePoint void Page_Load() Services object model, and then { send it down to the user via the SPWeb web = SPControl.GetContextWeb(Context); ASP.NET Response object. To string strPath = Request.QueryString[quot;FileNamequot;]; ensure that the document is saved locally rather than simple SPFile file=web.GetFile(strPath); being opened, the download will be marked as a simple octet if ((file.Exists) && (file.CheckOutStatus == stream rather than as a specific Microsoft.SharePoint.SPFile.SPCheckOutStatus.None)) Page 7 of 9
  • 10. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Tasks Detailed Steps document format for which an { application may be registered. Response.Clear(); file.CheckOut(); Response.AddHeader(quot;Content-Dispositionquot;, quot;attachment; filename=quot; + file.Name); Response.AddHeader (quot;Content-Lengthquot;, file.Length.ToString()); Response.ContentType = quot;application/octet-streamquot;; Response.BinaryWrite(file.OpenBinary()); } else { Response.Write(quot;The file does not existquot; + quot; or is already checked out.quot;); } } </script> f. Click File | Save All. g. Click File | Exit. Page 8 of 9
  • 11. Creating a Custom Site Definition for Microsoft Windows SharePoint Services Exercise 4 Create a New Site Based on the Custom Definition Scenario In this exercise, you will create a new site with your changes. Tasks Detailed Steps 1. Create a new site a. Maximize Internet Explorer. b. In the top navigation bar, click Sites. c. In the left navigation bar, under Actions, click Create Site. d. In the Title field, type New FOO Site. e. In the URL name field, type FOO. f. Click Create. g. Click OK. h. Select the FOO Site template you just created and click OK. i. Explore the site. Notice the My Site link in the top navigation bar. 2. Test the menu a. Return to the home page of the site you just created. b. In the left navigation bar, click Shared Documents. c. In the toolbar, click Upload Document. d. Click Browse. e. Navigate to C:Sales Fileshare, select Annual Report.doc and click Open. f. Click Save and Close. g. Once the document has been uploaded, let your mouse pointer hover over the uploaded document on the Shared Documents page. When the command list menu appears, click on the down arrow to display the list of possible commands. h. Select the Check Out command. i. Select the Edit in Microsoft Office Word command. The document will open in a new instance of Word. j. Click Ok to open the document. Page 9 of 9