SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Lab 12: Using Features to Provision Sites

          Objectives
          After completing this lab, you will be able to:

          •   Create a new Content Type as a new Feature
          •   Create and Provision a custom document library
          •   Create custom Actions to an existing list
          •   Apply the appropriate scope to a feature

          Prerequisites
          Before working on this lab, you must have:
          •   Labs 1 and 2 fully completed

          Scenario
          The objective of this lab is to gain an understanding of the new Features framework
          in Windows SharePoint Services 3.0 through an overview of the concepts and a
          walkthrough of several examples. The first exercise will walk you through the
          creation and provisioning of a custom document type. The second exercise walks
          through the elements of the custom document library related to Content Types.
          Finally, in the third exercise you will walk through associating Custom Actions to an
          existing Announcements list. These functionalities illustrated in this lab were either
          very difficult to do with custom lists or not possible at all in previous SharePoint
          version.

          Estimated time to complete this lab: 75 minutes



Exercise 1
Review the different elements that compose the HOLContentType
Feature
               In this exercise you will learn about different components of the custom HOLContentType
               feature. This feature creates a new Content Type called “HOL Document” based on the
               out-of-the-box “Document” Content Type and is categorized in a new “Content Type
               Group” called “HOL Content Type”.

              1. Login as the Administrator

              2. Open “C:HOLFeaturesHOLContentType” directory using Windows Explorer and
                 browse the files included in this feature.
Lab 12: Using Features to Provision Sites



                   3. Open the “feature.xml” file and notice that the “feature” has a unique id and it has been
                      scoped to a “Site”. The “Site” scope actually refers to the “Site Collection” of your
                      installation. A “Web’ is a single site of that Site Collection! Another important section to
                      notice is the “ElementManifests” element. It points to another file. The
                      HOLLibrary.xml file. The “feature.xml” file content of the HOLContentType feature is
                      listed below.

                   Note: A “content type” feature element needs to have a scope of “Site”.

                          <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
                          <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
                          <!-- _LocalBinding -->
                          < Feature Id=quot;983BCDE5-77A3-4aae-9F16-CD94BE238EF4quot;
                              Title=quot;HOL Librariesquot;
                              Description=quot;This feature provides support for a new
                          Content Type called HOL Document.quot;
                              Version=quot;1.0.0.0quot;
                              Scope=quot;Sitequot;
                              xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
                              <ElementManifests>
                                  <ElementManifest
                          Location=quot;HOLDocContentTypeHOLContentType.xmlquot; />
                              </ElementManifests>
                          </Feature>



Exercise 2
Package and Review a Content Type Feature
                         Content Type instances are based on an existing content type template. A content
                         type template can also be based on another content type template, retaining
                         references to them that define that parent-child relationship. Because of this, you
                         can create an entire Content Type hierarchy, where general Content Types serve as
                         the parent of more specific Content Types. In fact, Windows SharePoint Services
                         3.0 and Microsoft Office SharePoint Server 2007 (MOSS 2007) installs with such a
                         template hierarchy already included. Windows SharePoint Services 3.0 also
                         contains mechanisms for you to manage your Content Type groups and hierarchies,
                         and enables you (if so desired) to propagate changes made to the parent to the child
                         templates and instances as well.

                  Note: For more detailed information on Content Types, please see the dedicated lab on
                  this topic – Lab 7.

                  In this exercise we will walkthrough the Content Type elements of the HOL Document
                  Content Type feature covered in Exercise 1.



                  1. Browse the “C:HOLFeaturesHOLContentTypeHOLdocContentType” directory
                     and open the “HOLContentType.xml” file included in this feature.

                         The “HOLContentType.xml” file content is listed below:
Lab 12: Using Features to Provision Sites   3


                 <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
                 <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
                 <!-- _LocalBinding -->
                <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
                    <ContentType ID=quot;0x0101003D4F44E24FEF44BB93A8230B0E555023quot;
                        Name=quot;HOL Documentquot;
                        Group=quot;HOL Content Typesquot;
                        Description=quot;This is a document created at HOL.quot;
                        Version=quot;0quot;>
                        <FieldRefs>
                        </FieldRefs>
                    </ContentType>
                 </Elements>




Exercise 3
Install the HOLContentType Feature
              In this exercise you will install the HOLContentType feature.

                 1. Login as the Administrator

                 2. Open an “Office 12 Command Prompt” by double-clicking the shortcut found on
                    the desktop.

                 3. Navigate to the Feature directory by issuing the following command “cd
                    HOLFeatures”.

                 4. Copy the feature to the server’s feature folder with the following command: “xcopy
                    HOLContentType quot;C:Program FilesCommon FilesMicrosoft Sharedweb
                    server extensions12TEMPLATEFEATURESHOLContentTypequot; /s /y”

                 5. Install the feature to the server with the following command: “stsadm -o
                    installfeature -filename HOLContentTypefeature.xml”

                 6. Activate the feature for the Feature team site with the following command: “stsadm
                    -o activatefeature -filename HOLContentTypefeature.xml -url
                    http://hol.litwareinc.com”

                 Note: Due to the fact that “Content Types” have “Site” as scope, the top level site URL
                 is entered.

                 7. The “HOLContentType” Feature has been successfully installed. To verify this
                    installation, verify that the “HOL Content Types” group exist and list the “HOL
                    Document” Content Type by launching IE, clicking “Home”, “Site Actions”, “Site
                    Settings”, “Modify All Site Settings”, “Site Content Types” under the Galleries
                    section.
Lab 12: Using Features to Provision Sites



Exercise 4
Review the different elements that compose the HOLLibrary Feature
                     In this exercise you will learn about different components of the HOLLibrary feature. The
                     HOLLibrary feature will be the next feature you will install and it will be installed on a new
                     site you will create.

                     ∑ Create the HOL Feature site first
                          1. As an Administrator, create a Team Site called “HOL Feature” located under the
                             sitedirectory site. To do this, launch IE, click “Sites” in the top navigation, click
                             “Create Site”, enter “HOL Feature” in the Title and “HOLFeature” in the URL
                             name, and then select the “Team Site” template.

                          2.   Click “Create”.

                          3. Open the “C:HOLFeaturesHOLLibrary” directory with Windows Explorer and
                             browse the files included in this feature.

                          4. Open the “feature.xml” file and notice that the “feature” has a unique id and it has
                             been scoped to a “web”. Another important section to notice is the
                             “ElementManifests” element. It points to another file. The HOLLibrary.xml file.
                             The “feature.xml” file content is listed below:


       <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
       <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
       <!-- _LocalBinding -->
       <Feature Id=quot;35D10E49-31A2-4353-BD26-E44471968F03quot;
           Title=quot;HOL Librariesquot;
           Description=quot;This feature provides support for HOL libraries.quot;
           Version=quot;1.0.0.0quot;
           Scope=quot;Webquot;
           xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
           <ElementManifests>
               <ElementManifest Location=quot;ListTemplatesHOLLibrary.xmlquot; />
           </ElementManifests>
       </Feature>


                          5. Open and examine the HOLLibrary.xml file. Its content is listed below:

                          ♦    Notice that the ListTemplate name attribute is hollib which corresponds to the
                               HOLLib subdirectory and the files in it. Also, notice that we have provisioned an
                               instance of our library via the ListInstance tag at the Url HOLDocs.


       <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
       <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
       <!-- _LocalBinding -->
       <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
             <ListTemplate
                   Name=quot;hollibquot;
                   Type=quot;1500quot;
Lab 12: Using Features to Provision Sites   5


            BaseType=quot;1quot;
            OnQuickLaunch=quot;TRUEquot;
            SecurityBits=quot;11quot;
            DisplayName=quot;HOL Libraryquot;
            Description=quot;This library contains docs created at HOL.quot;
            Image=quot;/_layouts/images/itdl.gifquot;
            DocumentTemplate=quot;101quot;/>
      <ListInstance
            Id=quot;HOLLibraryquot;
            Title=quot;HOL Libraryquot;
            Description=quot;HOL Libraryquot;
            TemplateType=quot;1500quot;
            Url=quot;HOLDocsquot;/>
</Elements>


        6. Open the “C:HOLFeaturesHOLLibraryHOLLibschema.xml” file. The
           “schema.xml” file content is listed below:


           ♦    Notice the ContentTypes section. Content types provide a means to manage
                the metadata and behavior of SharePoint list items, making it possible to store
                different types of content within the same library or list.


   <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?>
   <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
   <!-- _LocalBinding -->
   <List xmlns:ows=quot;Microsoft SharePointquot;
            Name=quot;HOLLibraryquot;
            Title=quot;HOL Libraryquot;
            Direction=quot;LTRquot;
            Url=quot;Shared HOL Documentsquot;
            BaseType=quot;1quot;
            EnableContentTypes=quot;TRUEquot;>
      <MetaData>
           <ContentTypes>
            <ContentTypeRef ID=quot;0x0101quot;>
              <Folder TargetName=quot;Forms/Documentquot; />
            </ContentTypeRef>
            <ContentTypeRef
   ID=quot;0x0101003D4F44E24FEF44BB93A8230B0E555023quot; />
            <ContentTypeRef ID=quot;0x0120quot; />
          </ContentTypes>
          <Fields>
            <Field ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot;
   Type=quot;Textquot; Name=quot;Titlequot; ShowInNewForm=quot;FALSEquot;
   ShowInFileDlg=quot;FALSEquot; DisplayName=quot;Titlequot; Sealed=quot;TRUEquot;
   SourceID=quot;http://schemas.microsoft.com/sharepoint/v3quot;
   StaticName=quot;Titlequot;>
            </Field>
          </Fields>
                            ... Omitted for brevity ...
   </List>

               • Notice ContentTypeRef ID=quot;0x0101quot; that maps to the standard document
                 content type associated with Document Libraries. The Content Type inheritance
Lab 12: Using Features to Provision Sites


                         hierarchy is actually defined in the ID field. As such, this Content Type inherits
                         from ContentTypeRef ID=quot;0x01quot; the base Item content type which inherits from
                         ContentTypeRef ID=quot;0xquot; the System base content type.

                       • This file also contains the Folder Content Type definition found at
                         ContentTypeRef ID=quot;0x0120quot;.

                     7. To best understand how the ID attribute maps to the specific Content Type,
                        open the “ctypeswss.xml” file located at “C:Program FilesCommon
                        FilesMicrosoft Sharedweb server
                        extensions12TEMPLATEFEATURESctypesctypeswss.xml”. The
                        contents related to content types are shown below.



      <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
      <!--
      -->
      <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
           <ContentType ID=quot;0xquot;
               Name=quot;$Resources:Systemquot;
               Group=quot;_Hiddenquot;
               Sealed=quot;TRUEquot;
               Version=quot;0quot;>
               <FieldRefs>
                   <FieldRef ID=quot;{c042a256-787d-4a6f-8a8a-cf6ab767f12d}quot;
      Name=quot;ContentTypequot;/>
               </FieldRefs>
           </ContentType>
           <ContentType ID=quot;0x01quot;
               Name=quot;$Resources:Itemquot;
               Group=quot;$Resources:List_Content_Typesquot;
               Description=quot;$Resources:ItemCTDescquot;
               Version=quot;0quot;>
               <FieldRefs>
                   <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot;
      Name=quot;Titlequot; Required=quot;TRUEquot; ShowInNewForm=quot;TRUEquot; ShowInEditForm=quot;TRUEquot;/>
      <!-- Title -->
               </FieldRefs>
               <XmlDocuments>
                   <XmlDocument
      NamespaceURI=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;>
                       <FormTemplates
      xmlns=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;>
                            <Display>ListForm</Display>
                            <Edit>ListForm</Edit>
                            <New>ListForm</New>
                       </FormTemplates>
                   </XmlDocument>
               </XmlDocuments>
           </ContentType>
           <ContentType ID=quot;0x0101quot;
               Name=quot;$Resources:Documentquot;
               Group=quot;$Resources:Document_Content_Typesquot;
               Description=quot;$Resources:DocumentCTDescquot;
               V2ListTemplateName=quot;doclibquot;
               Version=quot;0quot;>
               <FieldRefs>
Lab 12: Using Features to Provision Sites   7


            <RemoveFieldRef ID=quot;{67df98f4-9dec-48ff-a553-29bece9c5bf4}quot;
Name=quot;Attachmentsquot; /> <!-- Attachments -->
            <RemoveFieldRef ID=quot;{f1e020bc-ba26-443f-bf2f-b68715017bbc}quot;
Name=quot;WorkflowVersionquot; /> <!-- WorkflowVersion -->
            <RemoveFieldRef ID=quot;{bc91a437-52e7-49e1-8c4e-4698904b2b6d}quot;
Name=quot;LinkTitleNoMenuquot; /> <!-- LinkTitleNoMenu -->
            <RemoveFieldRef ID=quot;{82642ec8-ef9b-478f-acf9-31f7d45fbc31}quot;
Name=quot;LinkTitlequot; /> <!-- LinkTitle -->
            <RemoveFieldRef ID=quot;{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}quot;
Name=quot;GUIDquot; /> <!-- GUID -->
            <RemoveFieldRef ID=quot;{de8beacf-5505-47cd-80a6-aa44e7ffe2f4}quot;
Name=quot;WorkflowInstanceIDquot; /> <!-- WorkflowInstanceID -->
            <FieldRef ID=quot;{5f47e085-2150-41dc-b661-442f3027f552}quot;
Name=quot;SelectFilenamequot; /> <!-- SelectFilename -->
            <FieldRef ID=quot;{8553196d-ec8d-4564-9861-3dbe931050c8}quot;
Name=quot;FileLeafRefquot; Required=quot;TRUEquot;/> <!-- FileLeafRef -->
            <FieldRef ID=quot;{8c06beca-0777-48f7-91c7-6da68bc07b69}quot;
Name=quot;Createdquot; Hidden=quot;TRUEquot; /> <!-- Created -->
            <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot;
Name=quot;Titlequot; Required=quot;FALSEquot; ShowInNewForm=quot;FALSEquot; ShowInEditForm=quot;TRUEquot;/>
<!-- Title -->
            <!-- TODO: The old display name was: 'DisplayName=quot;Created
Datequot;>__LDisp(camlionet37)' We may need to special case this for back compat
-->
            <FieldRef ID=quot;{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}quot;
Name=quot;Modifiedquot; Hidden=quot;TRUEquot; /> <!-- Modified -->
            <!-- TODO: The old display name was: 'DisplayName=quot;Last
Modifiedquot;>__LDisp(camlionet36)' We may need to special case this for back
compat -->
<FieldRef ID=quot;{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}quot; Name=quot;Modifiedquot;
Hidden=quot;TRUEquot; /> <!-- Modified -->
            <!-- TODO hailiu: The old display name was:
'DisplayName=quot;$Resources:core,Last_Modified;quot;>__LDisp(camlionet36)' We may
need to special case this for back compat -->
            <FieldRef ID=quot;{822c78e3-1ea9-4943-b449-57863ad33ca9}quot;
Name=quot;Modified_x0020_Byquot; Hidden=quot;FALSEquot;/> <!-- Modified_x0020_By -->
            <FieldRef ID=quot;{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}quot;
Name=quot;Created_x0020_Byquot; Hidden=quot;FALSEquot; /> <!-- Created_x0020_By -->
        </FieldRefs>
        <XmlDocuments>
            <XmlDocument
NamespaceURI=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;>
                <FormTemplates
xmlns=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;>
                     <Display>DocumentLibraryForm</Display>
                     <Edit>DocumentLibraryForm</Edit>
                     <New>DocumentLibraryForm</New>
                </FormTemplates>
            </XmlDocument>
        </XmlDocuments>
                        </ContentType>
                    ... Omitted for brevity ...
    <ContentType ID=quot;0x0120quot;
        Name=quot;$Resources:Folderquot;
        Group=quot;$Resources:Folder_Content_Typesquot;
        Description=quot;$Resources:FolderCTDescquot;
        Sealed=quot;TRUEquot;
        Version=quot;0quot;>
        <FieldRefs>
Lab 12: Using Features to Provision Sites


                       <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot;
           Name=quot;Titlequot; Required=quot;FALSEquot; Hidden=quot;TRUEquot;/> <!-- Title -->
                       <FieldRef ID=quot;{8553196d-ec8d-4564-9861-3dbe931050c8}quot;
           Name=quot;FileLeafRefquot; Hidden=quot;FALSEquot;/> <!-- FileLeafRef -->
                   </FieldRefs>
               </ContentType>
                              ... Omitted for brevity ...
                              </Elements>




Exercise 5
Check the state of the HOL Feature site prior to installing the new Library
Feature
                     In this exercise you will check the current state of the HOL Feature sire you created in
                     exercise 4. You will notice that their will be only one Document Library (Shared
                     Documents) currently available.

                          1. Launch IE and navigate to the HOL Feature site located at
                             “http://hol.litwareinc.com/sitedirectory/HOL Feature”.

                          2. Click on “View All Site Content” located on the top left navigation element and
                             notice the site has only one Shared Documents library under the Document
                             Libraries section.

                          3. Keep your web browser on this page.




Exercise 6
Install the HOLLibrary feature
                     In this exercise you will create and install a new feature (HOLLibrary) which will create the
                     HOL Library document library. This library is a simple reuse of the standard Document
                     Library (via copy-paste-rename) installed with Windows SharePoint Services 3.0. Using the
                     functionality of Features, we will create an instance of a Document Library and a Content
                     Type of “HOL Document” which will then be included in the root of the site on which we
                     activate our feature on.


                     ∑ Install the feature
                          1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking
                             the shortcut found on the desktop.
Lab 12: Using Features to Provision Sites   9


                 2. Navigate to the Feature directory by issuing the following command “cd
                    HOLFeatures” if not already there.

                 3. Copy the HOLLibrary feature to the server with the following command: “xcopy
                    HOLLibrary quot;C:Program FilesCommon FilesMicrosoft Sharedweb server
                    extensions12TEMPLATEFEATURESHOLLibraryquot; /s /y”

                 4. Install the feature to the server with the following command: “stsadm -o
                    installfeature -filename HOLLibraryfeature.xml”

                 5. Activate the feature for the Feature team site with the following command: “stsadm
                    -o activatefeature -filename HOLLibraryfeature.xml -url
                    http://hol.litwareinc.com/SiteDirectory/HOLFeature”

                 6. The HOL Library Feature has been successfully installed. To verify this, refresh the
                    All Content page of the “HOL Feature” site. Click on the “HOL Library”
                    document library and then click the down arrow beside New. You should have a
                    new document type called “HOL Document”.



Exercise 7
Review the different elements that compose the HOLSimpleFormToolBar
Feature
              In this exercise we will review a feature that installs “Custom Actions” for the standard
              Announcements list that navigates to a custom web part page also installed by this feature.

              ∑ Review the Feature

                 1. Open “C:HOLFeaturesHOLSimpleFormToolbar” directory and review the
                    files included in this feature.

                 2. Open “C:HOLFeaturesHOLSimpleFormToolbarfeature.xml”. The
                    “feature.xml” file content is listed below:

                 3. Notice the ElementManifest that points to the next important files for parsing
                    elements.xml and ElementFile. The ElementFile points to our custom web part page
                    sampleurl.aspx.




       <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
       <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
       <!-- _LocalBinding -->
       <Feature Id=quot;72A67618-42FA-4dbb-A6F8-566EF1393F18quot;
           Title=quot;New Simple Form ToolBar Buttonquot;
           Scope=quot;Webquot;
           xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
           <ElementManifests>
             <ElementManifest Location=quot;elements.xmlquot; />
Lab 12: Using Features to Provision Sites


            <ElementFile Location=quot;sampleurl.aspxquot; />
       </ElementManifests>
   </Feature>




                   4. Open “C:HOLFeaturesHOLSimpleFormToolbarelements.xml”. The contents
                      are shown below.

                   Notice the CustomAction tags that create two toolbar buttons and an admin page link
                   that point to our custom page sampleurl.aspx. Additionally, notice that the Module
                   section is used to provision our custom web part page at the root of the site.




 <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?>
 <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; -->
 <!-- _LocalBinding -->
 <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;>
       <CustomAction Title=quot;Simple (Display)quot;
             Id=quot;Simple Toolbar (Display)quot;
             Sequence=quot;100quot;
             RegistrationType=quot;Listquot;
             RegistrationId=quot;104quot;
             Location=quot;DisplayFormToolbarquot;>
             <UrlAction Url=quot;sampleurl.aspx?id={ItemId}quot; />
       </CustomAction>
       <CustomAction Title=quot;Simple (Edit)quot;
             Id=quot;Simple Toolbar (Edit)quot;
             Sequence=quot;110quot;
             RegistrationType=quot;Listquot;
             RegistrationId=quot;104quot;
             Location=quot;EditFormToolbarquot;>
             <UrlAction Url=quot;sampleurl.aspxquot; />
       </CustomAction>
       <CustomAction Title=quot;Simple Pagequot;
             Id=quot;Simple Settings Pagequot;
             Sequence=quot;50quot;
             GroupId=quot;SiteAdministrationquot;
             Location=quot;Microsoft.SharePoint.SiteSettingsquot;
             Rights=quot;ManageListsquot;>
             <UrlAction Url=quot;sampleurl.aspxquot; />
       </CustomAction>

       <Module Name=quot;SamplePagequot; Url=quot;quot; Path=quot;quot;>
             <File Url=quot;sampleurl.aspxquot; />
       </Module>
 </Elements>


                   5. Open “C:HOLFeaturesHOLSimpleFormToolbarsampleurl.aspx”. The
                      “samplerurl.aspx” file content is listed below:
Lab 12: Using Features to Provision Sites    11


                  Notice that the <script> block which simply renders our Announcements list in a list
                  box. Additionally, notice the asp:Content tags that are used to layout our page utilizing
                  the ASP.NET 2.0 Master Pages functionality.



<%@ Page language=quot;C#quot; MasterPageFile=quot;~masterurl/default.masterquot;
Inherits=quot;Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Versi
on=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429cquot; %>
<%@ Register Tagprefix=quot;SharePointquot; Namespace=quot;Microsoft.SharePoint.WebControlsquot;
Assembly=quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429cquot; %>
<%@ Register Tagprefix=quot;Utilitiesquot; Namespace=quot;Microsoft.SharePoint.Utilitiesquot;
Assembly=quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429cquot; %>
<%@ Import Namespace=quot;Microsoft.SharePointquot; %>

<asp:Content ContentPlaceHolderId=quot;PlaceHolderPageTitlequot;
runat=quot;serverquot;></asp:Content>
<asp:Content ContentPlaceHolderId=quot;PlaceHolderAdditionalPageHeadquot;
runat=quot;serverquot;></asp:Content>
<asp:Content ContentPlaceHolderId=quot;PlaceHolderPageImagequot;
runat=quot;serverquot;></asp:Content>

<asp:Content ContentPlaceHolderId=quot;PlaceHolderPageTitleInTitleAreaquot;
runat=quot;serverquot;>
   Announcements List via Code
</asp:Content>
<asp:Content ContentPlaceHolderId=quot;PlaceHolderPageDescriptionquot;
runat=quot;serverquot;></asp:Content>

<asp:Content ContentPlaceHolderId=quot;PlaceHolderMainquot; runat=quot;serverquot;>
<asp:ListBox ID=quot;AnnouncementsListquot; runat=quot;serverquot; />
      <script language=quot;C#quot; runat=server>
            protected override void OnLoad(EventArgs e)
            {
                  if (!this.IsPostBack)
                  {
                        // Get the announcements list
                        SPWeb web = SPContext.GetContext(this.Context).Web;
                        SPList list =
web.GetListFromUrl(quot;Lists/Announcements/AllItems.aspxquot;);

                             // populate the list box with values from it
                             SPDataSource dataSource = new SPDataSource();
                             dataSource.List = list;
                             this.AnnouncementsList.DataSource = dataSource;
                             this.AnnouncementsList.DataTextField = quot;Titlequot;;
                             this.AnnouncementsList.DataValueField = quot;Titlequot;;
                             this.AnnouncementsList.DataBind();
                     }
                     base.OnLoad(e);
            }
      </script>
</asp:Content>
Lab 12: Using Features to Provision Sites



Exercise 8
Install the HOLSimpleFormToolBar feature
                    In this exercise you will install the HOLSimpleFormToolBar feature. This feature adds a
                    button at three different locations a) on the announcement itself b) the “Announcement” list
                    and c) in the “Site Administration” section.

                    ∑ Install the HOLSimpleFormToolBar feature
                        1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking
                           the shortcut found on the desktop.

                        2. Navigate to the Feature directory by issuing the following command “cd
                           HOLFeatures”

                        3. Copy the HOLLibrary feature to the server with the following command: “xcopy
                           HOLSimpleFormToolBar quot;C:Program FilesCommon FilesMicrosoft Shared
                           web server
                           extensions12TEMPLATEFEATURESHOLSimpleFormToolBarquot; /s /y”

                        4. Install the feature to the server with the following command: “stsadm -o
                           installfeature -filename HOLSimpleFormToolBarfeature.xml”

                        5. Activate the feature for the Feature team site with the following command: “stsadm
                           -o activatefeature -filename HOLSimpleFormToolBarfeature.xml -url
                           http://hol.litwareinc.com/siteDirectory/HOLFeature”

                        6. The HOLSimpleFormToolBar Feature has been successfully installed. To verify this
                           installation, Open IE and navigate to the “HOL Feature” site at
                           “http://hol.litwareinc.com/sitedirectory/HOLFeature” and click the “Get Started
                           with Windows SharePoint Services!” link under Announcements




                        7. Note the Simple (Display) button on the toolbar. Click the “Simple(Display)” link




                        Notice that you are taken to the sample page included in your HOLSimpleFormToolBar
                        feature. This page displays all the announcements in the site in a multi-select form field.
Lab 12: Using Features to Provision Sites     13




8. Return to the “HOL Feature” site home page.

9. Click on the “Annoucements” link



10. Mouse over the accouncement and click the down arrow and select “Edit Item”
    from the “Get Started with Windows SharePoint Services!” action menu.




11. Notice the Simple (Edit) button on the toolbar. Click that link.




Note that you are again taken to the same sample page included in our feature.
Lab 12: Using Features to Provision Sites




                   12. Return to the “HOL Feature” site home page.

                   13. Go to the site settings page by clicking on “Site Settings” from the “Site Actions”
                       menu.




                   14. Notice the “Simple Page” link in the “Site Administration” section. Click that link




                   15. You are again taken to the same sample page included in our feature.
Lab 12: Using Features to Provision Sites     15




                 16. Return to the “HOL Feature” site home page.

                 You have now installed and tested three powerful customizations addressing specific
                 needs of site Administrators and content contributors.



Exercise 9
Deactivate a Feature
              In this exercise you will deactivate (remove) the toolbar buttons and Site Administration
              option.

              ∑ Deactivate feature
                 1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking
                    the shortcut found on the desktop.

                 2. Navigate to the Feature directory by issuing the following command “cd
                    HOLFeatures”

                 You do not need to uninstall the feature for it to no longer be avaialble to the site. The
                 deactivatefeature command remove all components of the feature. Issue the following
                 command and check if the buttons and option under the Site Administration are still
                 available. They should not be!

                 3. Deactivate the feature for the HOLFeature team site with the following command:
                    “stsadm -o deactivatefeature -filename HOLSimpleFormToolBarfeature.xml -
                    url http://hol.litwareinc.com/siteDirectory/HOLFeature”

                 4. Verify that all buttons are no longer available and that the Site Administration
                    “Simple Page” was removed.

                 Lab Completed!

Weitere ähnliche Inhalte

Was ist angesagt?

Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
Deploying configuring caching
Deploying configuring cachingDeploying configuring caching
Deploying configuring cachingaspnet123
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Rashedul Islam
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewRob Windsor
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...Integrating Plone with E-Commerce and Relationship Management: A Case Study i...
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...David Glick
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 Mark Rackley
 
Automation Anywhere Case study
Automation Anywhere Case studyAutomation Anywhere Case study
Automation Anywhere Case studyShekar S
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownMark Rackley
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQueryMark Rackley
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationAdil Ansari
 
OOP Adventures with XOOPS
OOP Adventures with XOOPSOOP Adventures with XOOPS
OOP Adventures with XOOPSxoopsproject
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointRene Modery
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIQUONTRASOLUTIONS
 

Was ist angesagt? (20)

Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
Tomcat + other things
Tomcat + other thingsTomcat + other things
Tomcat + other things
 
Deploying configuring caching
Deploying configuring cachingDeploying configuring caching
Deploying configuring caching
 
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
Step 8_7_ 6_5_4_3_2_ 1 in one_Tutorial for Begineer on Selenium Web Driver-Te...
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
tut0000021-hevery
tut0000021-heverytut0000021-hevery
tut0000021-hevery
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Adobe Flex4
Adobe Flex4 Adobe Flex4
Adobe Flex4
 
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...Integrating Plone with E-Commerce and Relationship Management: A Case Study i...
Integrating Plone with E-Commerce and Relationship Management: A Case Study i...
 
SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013 SharePoint & jQuery Guide - SPSTC 5/18/2013
SharePoint & jQuery Guide - SPSTC 5/18/2013
 
Using database in android
Using database in androidUsing database in android
Using database in android
 
Automation Anywhere Case study
Automation Anywhere Case studyAutomation Anywhere Case study
Automation Anywhere Case study
 
Jsp element
Jsp elementJsp element
Jsp element
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
SharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuerySharePoint Saturday St. Louis - SharePoint & jQuery
SharePoint Saturday St. Louis - SharePoint & jQuery
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
SharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote AuthenticationSharePoint 2013 REST API & Remote Authentication
SharePoint 2013 REST API & Remote Authentication
 
OOP Adventures with XOOPS
OOP Adventures with XOOPSOOP Adventures with XOOPS
OOP Adventures with XOOPS
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
Introduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST APIIntroduction to SharePoint 2013 REST API
Introduction to SharePoint 2013 REST API
 

Ähnlich wie ( 12 ) Office 2007 Features Custom List

Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)Ivy Rueb
 
Instagram filters
Instagram filters Instagram filters
Instagram filters Thinkful
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...buildacloud
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collabKaren Vuong
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records SiteLiquidHub
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)Ivy Rueb
 
SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488Ahmed Tawfik
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records SiteLiquidHub
 
Jsf2 composite-components
Jsf2 composite-componentsJsf2 composite-components
Jsf2 composite-componentsvinaysbk
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data CatologLiquidHub
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipeilittlebtc
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperFabrit Global
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 

Ähnlich wie ( 12 ) Office 2007 Features Custom List (20)

Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
Instagram filters
Instagram filters Instagram filters
Instagram filters
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collab
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records Site
 
Instagram filters (8 24)
Instagram filters (8 24)Instagram filters (8 24)
Instagram filters (8 24)
 
SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488SharePoint solution developer exam 70-488
SharePoint solution developer exam 70-488
 
( 4 ) Office 2007 Configure The Official Records Site
( 4 ) Office 2007   Configure The Official Records Site( 4 ) Office 2007   Configure The Official Records Site
( 4 ) Office 2007 Configure The Official Records Site
 
Jsf2 composite-components
Jsf2 composite-componentsJsf2 composite-components
Jsf2 composite-components
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data Catolog
 
cc.pdf
cc.pdfcc.pdf
cc.pdf
 
cc.pdf
cc.pdfcc.pdf
cc.pdf
 
cc1.pdf
cc1.pdfcc1.pdf
cc1.pdf
 
cc.pdf
cc.pdfcc.pdf
cc.pdf
 
cc.pdf
cc.pdfcc.pdf
cc.pdf
 
MozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: TaipeiMozTW Jetpack Workshop: Taipei
MozTW Jetpack Workshop: Taipei
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
Ext 0523
Ext 0523Ext 0523
Ext 0523
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Mdst 3559-02-10-jquery
Mdst 3559-02-10-jqueryMdst 3559-02-10-jquery
Mdst 3559-02-10-jquery
 

Mehr von LiquidHub

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.0LiquidHub
 
Sharepoint 2013 upgrade process
Sharepoint 2013 upgrade processSharepoint 2013 upgrade process
Sharepoint 2013 upgrade processLiquidHub
 
Share point 2013
Share point 2013Share point 2013
Share point 2013LiquidHub
 
Share point 2010-uiimprovements
Share point 2010-uiimprovementsShare point 2010-uiimprovements
Share point 2010-uiimprovementsLiquidHub
 
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-2LiquidHub
 
Managing metadata in_share_point_2010
Managing metadata in_share_point_2010Managing metadata in_share_point_2010
Managing metadata in_share_point_2010LiquidHub
 
Fast search for share point
Fast search for share pointFast search for share point
Fast search for share pointLiquidHub
 
Simple Farm Server Deployment
Simple Farm Server DeploymentSimple Farm Server Deployment
Simple Farm Server DeploymentLiquidHub
 
Pre Install Databases
Pre Install DatabasesPre Install Databases
Pre Install DatabasesLiquidHub
 
Moss 2007 Deployment Detail
Moss 2007 Deployment DetailMoss 2007 Deployment Detail
Moss 2007 Deployment DetailLiquidHub
 
Moss 2007 Backup Strategies
Moss 2007 Backup StrategiesMoss 2007 Backup Strategies
Moss 2007 Backup StrategiesLiquidHub
 
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 2003LiquidHub
 
5060 A 01 Demonstration Steps
5060 A 01 Demonstration Steps5060 A 01 Demonstration Steps
5060 A 01 Demonstration StepsLiquidHub
 
Working With Infopath 2007
Working With Infopath 2007Working With Infopath 2007
Working With Infopath 2007LiquidHub
 
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 WalkthroughLiquidHub
 
Overviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshOverviewofthe2007 Microsoft Office System Components Refresh
Overviewofthe2007 Microsoft Office System Components RefreshLiquidHub
 
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 RefreshLiquidHub
 

Mehr von 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
 
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
 

Kürzlich hochgeladen

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

( 12 ) Office 2007 Features Custom List

  • 1. Lab 12: Using Features to Provision Sites Objectives After completing this lab, you will be able to: • Create a new Content Type as a new Feature • Create and Provision a custom document library • Create custom Actions to an existing list • Apply the appropriate scope to a feature Prerequisites Before working on this lab, you must have: • Labs 1 and 2 fully completed Scenario The objective of this lab is to gain an understanding of the new Features framework in Windows SharePoint Services 3.0 through an overview of the concepts and a walkthrough of several examples. The first exercise will walk you through the creation and provisioning of a custom document type. The second exercise walks through the elements of the custom document library related to Content Types. Finally, in the third exercise you will walk through associating Custom Actions to an existing Announcements list. These functionalities illustrated in this lab were either very difficult to do with custom lists or not possible at all in previous SharePoint version. Estimated time to complete this lab: 75 minutes Exercise 1 Review the different elements that compose the HOLContentType Feature In this exercise you will learn about different components of the custom HOLContentType feature. This feature creates a new Content Type called “HOL Document” based on the out-of-the-box “Document” Content Type and is categorized in a new “Content Type Group” called “HOL Content Type”. 1. Login as the Administrator 2. Open “C:HOLFeaturesHOLContentType” directory using Windows Explorer and browse the files included in this feature.
  • 2. Lab 12: Using Features to Provision Sites 3. Open the “feature.xml” file and notice that the “feature” has a unique id and it has been scoped to a “Site”. The “Site” scope actually refers to the “Site Collection” of your installation. A “Web’ is a single site of that Site Collection! Another important section to notice is the “ElementManifests” element. It points to another file. The HOLLibrary.xml file. The “feature.xml” file content of the HOLContentType feature is listed below. Note: A “content type” feature element needs to have a scope of “Site”. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> < Feature Id=quot;983BCDE5-77A3-4aae-9F16-CD94BE238EF4quot; Title=quot;HOL Librariesquot; Description=quot;This feature provides support for a new Content Type called HOL Document.quot; Version=quot;1.0.0.0quot; Scope=quot;Sitequot; xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ElementManifests> <ElementManifest Location=quot;HOLDocContentTypeHOLContentType.xmlquot; /> </ElementManifests> </Feature> Exercise 2 Package and Review a Content Type Feature Content Type instances are based on an existing content type template. A content type template can also be based on another content type template, retaining references to them that define that parent-child relationship. Because of this, you can create an entire Content Type hierarchy, where general Content Types serve as the parent of more specific Content Types. In fact, Windows SharePoint Services 3.0 and Microsoft Office SharePoint Server 2007 (MOSS 2007) installs with such a template hierarchy already included. Windows SharePoint Services 3.0 also contains mechanisms for you to manage your Content Type groups and hierarchies, and enables you (if so desired) to propagate changes made to the parent to the child templates and instances as well. Note: For more detailed information on Content Types, please see the dedicated lab on this topic – Lab 7. In this exercise we will walkthrough the Content Type elements of the HOL Document Content Type feature covered in Exercise 1. 1. Browse the “C:HOLFeaturesHOLContentTypeHOLdocContentType” directory and open the “HOLContentType.xml” file included in this feature. The “HOLContentType.xml” file content is listed below:
  • 3. Lab 12: Using Features to Provision Sites 3 <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ContentType ID=quot;0x0101003D4F44E24FEF44BB93A8230B0E555023quot; Name=quot;HOL Documentquot; Group=quot;HOL Content Typesquot; Description=quot;This is a document created at HOL.quot; Version=quot;0quot;> <FieldRefs> </FieldRefs> </ContentType> </Elements> Exercise 3 Install the HOLContentType Feature In this exercise you will install the HOLContentType feature. 1. Login as the Administrator 2. Open an “Office 12 Command Prompt” by double-clicking the shortcut found on the desktop. 3. Navigate to the Feature directory by issuing the following command “cd HOLFeatures”. 4. Copy the feature to the server’s feature folder with the following command: “xcopy HOLContentType quot;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURESHOLContentTypequot; /s /y” 5. Install the feature to the server with the following command: “stsadm -o installfeature -filename HOLContentTypefeature.xml” 6. Activate the feature for the Feature team site with the following command: “stsadm -o activatefeature -filename HOLContentTypefeature.xml -url http://hol.litwareinc.com” Note: Due to the fact that “Content Types” have “Site” as scope, the top level site URL is entered. 7. The “HOLContentType” Feature has been successfully installed. To verify this installation, verify that the “HOL Content Types” group exist and list the “HOL Document” Content Type by launching IE, clicking “Home”, “Site Actions”, “Site Settings”, “Modify All Site Settings”, “Site Content Types” under the Galleries section.
  • 4. Lab 12: Using Features to Provision Sites Exercise 4 Review the different elements that compose the HOLLibrary Feature In this exercise you will learn about different components of the HOLLibrary feature. The HOLLibrary feature will be the next feature you will install and it will be installed on a new site you will create. ∑ Create the HOL Feature site first 1. As an Administrator, create a Team Site called “HOL Feature” located under the sitedirectory site. To do this, launch IE, click “Sites” in the top navigation, click “Create Site”, enter “HOL Feature” in the Title and “HOLFeature” in the URL name, and then select the “Team Site” template. 2. Click “Create”. 3. Open the “C:HOLFeaturesHOLLibrary” directory with Windows Explorer and browse the files included in this feature. 4. Open the “feature.xml” file and notice that the “feature” has a unique id and it has been scoped to a “web”. Another important section to notice is the “ElementManifests” element. It points to another file. The HOLLibrary.xml file. The “feature.xml” file content is listed below: <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Feature Id=quot;35D10E49-31A2-4353-BD26-E44471968F03quot; Title=quot;HOL Librariesquot; Description=quot;This feature provides support for HOL libraries.quot; Version=quot;1.0.0.0quot; Scope=quot;Webquot; xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ElementManifests> <ElementManifest Location=quot;ListTemplatesHOLLibrary.xmlquot; /> </ElementManifests> </Feature> 5. Open and examine the HOLLibrary.xml file. Its content is listed below: ♦ Notice that the ListTemplate name attribute is hollib which corresponds to the HOLLib subdirectory and the files in it. Also, notice that we have provisioned an instance of our library via the ListInstance tag at the Url HOLDocs. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ListTemplate Name=quot;hollibquot; Type=quot;1500quot;
  • 5. Lab 12: Using Features to Provision Sites 5 BaseType=quot;1quot; OnQuickLaunch=quot;TRUEquot; SecurityBits=quot;11quot; DisplayName=quot;HOL Libraryquot; Description=quot;This library contains docs created at HOL.quot; Image=quot;/_layouts/images/itdl.gifquot; DocumentTemplate=quot;101quot;/> <ListInstance Id=quot;HOLLibraryquot; Title=quot;HOL Libraryquot; Description=quot;HOL Libraryquot; TemplateType=quot;1500quot; Url=quot;HOLDocsquot;/> </Elements> 6. Open the “C:HOLFeaturesHOLLibraryHOLLibschema.xml” file. The “schema.xml” file content is listed below: ♦ Notice the ContentTypes section. Content types provide a means to manage the metadata and behavior of SharePoint list items, making it possible to store different types of content within the same library or list. <?xml version=quot;1.0quot; encoding=quot;utf-8quot;?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <List xmlns:ows=quot;Microsoft SharePointquot; Name=quot;HOLLibraryquot; Title=quot;HOL Libraryquot; Direction=quot;LTRquot; Url=quot;Shared HOL Documentsquot; BaseType=quot;1quot; EnableContentTypes=quot;TRUEquot;> <MetaData> <ContentTypes> <ContentTypeRef ID=quot;0x0101quot;> <Folder TargetName=quot;Forms/Documentquot; /> </ContentTypeRef> <ContentTypeRef ID=quot;0x0101003D4F44E24FEF44BB93A8230B0E555023quot; /> <ContentTypeRef ID=quot;0x0120quot; /> </ContentTypes> <Fields> <Field ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot; Type=quot;Textquot; Name=quot;Titlequot; ShowInNewForm=quot;FALSEquot; ShowInFileDlg=quot;FALSEquot; DisplayName=quot;Titlequot; Sealed=quot;TRUEquot; SourceID=quot;http://schemas.microsoft.com/sharepoint/v3quot; StaticName=quot;Titlequot;> </Field> </Fields> ... Omitted for brevity ... </List> • Notice ContentTypeRef ID=quot;0x0101quot; that maps to the standard document content type associated with Document Libraries. The Content Type inheritance
  • 6. Lab 12: Using Features to Provision Sites hierarchy is actually defined in the ID field. As such, this Content Type inherits from ContentTypeRef ID=quot;0x01quot; the base Item content type which inherits from ContentTypeRef ID=quot;0xquot; the System base content type. • This file also contains the Folder Content Type definition found at ContentTypeRef ID=quot;0x0120quot;. 7. To best understand how the ID attribute maps to the specific Content Type, open the “ctypeswss.xml” file located at “C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURESctypesctypeswss.xml”. The contents related to content types are shown below. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- --> <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ContentType ID=quot;0xquot; Name=quot;$Resources:Systemquot; Group=quot;_Hiddenquot; Sealed=quot;TRUEquot; Version=quot;0quot;> <FieldRefs> <FieldRef ID=quot;{c042a256-787d-4a6f-8a8a-cf6ab767f12d}quot; Name=quot;ContentTypequot;/> </FieldRefs> </ContentType> <ContentType ID=quot;0x01quot; Name=quot;$Resources:Itemquot; Group=quot;$Resources:List_Content_Typesquot; Description=quot;$Resources:ItemCTDescquot; Version=quot;0quot;> <FieldRefs> <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot; Name=quot;Titlequot; Required=quot;TRUEquot; ShowInNewForm=quot;TRUEquot; ShowInEditForm=quot;TRUEquot;/> <!-- Title --> </FieldRefs> <XmlDocuments> <XmlDocument NamespaceURI=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;> <FormTemplates xmlns=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;> <Display>ListForm</Display> <Edit>ListForm</Edit> <New>ListForm</New> </FormTemplates> </XmlDocument> </XmlDocuments> </ContentType> <ContentType ID=quot;0x0101quot; Name=quot;$Resources:Documentquot; Group=quot;$Resources:Document_Content_Typesquot; Description=quot;$Resources:DocumentCTDescquot; V2ListTemplateName=quot;doclibquot; Version=quot;0quot;> <FieldRefs>
  • 7. Lab 12: Using Features to Provision Sites 7 <RemoveFieldRef ID=quot;{67df98f4-9dec-48ff-a553-29bece9c5bf4}quot; Name=quot;Attachmentsquot; /> <!-- Attachments --> <RemoveFieldRef ID=quot;{f1e020bc-ba26-443f-bf2f-b68715017bbc}quot; Name=quot;WorkflowVersionquot; /> <!-- WorkflowVersion --> <RemoveFieldRef ID=quot;{bc91a437-52e7-49e1-8c4e-4698904b2b6d}quot; Name=quot;LinkTitleNoMenuquot; /> <!-- LinkTitleNoMenu --> <RemoveFieldRef ID=quot;{82642ec8-ef9b-478f-acf9-31f7d45fbc31}quot; Name=quot;LinkTitlequot; /> <!-- LinkTitle --> <RemoveFieldRef ID=quot;{ae069f25-3ac2-4256-b9c3-15dbc15da0e0}quot; Name=quot;GUIDquot; /> <!-- GUID --> <RemoveFieldRef ID=quot;{de8beacf-5505-47cd-80a6-aa44e7ffe2f4}quot; Name=quot;WorkflowInstanceIDquot; /> <!-- WorkflowInstanceID --> <FieldRef ID=quot;{5f47e085-2150-41dc-b661-442f3027f552}quot; Name=quot;SelectFilenamequot; /> <!-- SelectFilename --> <FieldRef ID=quot;{8553196d-ec8d-4564-9861-3dbe931050c8}quot; Name=quot;FileLeafRefquot; Required=quot;TRUEquot;/> <!-- FileLeafRef --> <FieldRef ID=quot;{8c06beca-0777-48f7-91c7-6da68bc07b69}quot; Name=quot;Createdquot; Hidden=quot;TRUEquot; /> <!-- Created --> <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot; Name=quot;Titlequot; Required=quot;FALSEquot; ShowInNewForm=quot;FALSEquot; ShowInEditForm=quot;TRUEquot;/> <!-- Title --> <!-- TODO: The old display name was: 'DisplayName=quot;Created Datequot;>__LDisp(camlionet37)' We may need to special case this for back compat --> <FieldRef ID=quot;{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}quot; Name=quot;Modifiedquot; Hidden=quot;TRUEquot; /> <!-- Modified --> <!-- TODO: The old display name was: 'DisplayName=quot;Last Modifiedquot;>__LDisp(camlionet36)' We may need to special case this for back compat --> <FieldRef ID=quot;{28cf69c5-fa48-462a-b5cd-27b6f9d2bd5f}quot; Name=quot;Modifiedquot; Hidden=quot;TRUEquot; /> <!-- Modified --> <!-- TODO hailiu: The old display name was: 'DisplayName=quot;$Resources:core,Last_Modified;quot;>__LDisp(camlionet36)' We may need to special case this for back compat --> <FieldRef ID=quot;{822c78e3-1ea9-4943-b449-57863ad33ca9}quot; Name=quot;Modified_x0020_Byquot; Hidden=quot;FALSEquot;/> <!-- Modified_x0020_By --> <FieldRef ID=quot;{4dd7e525-8d6b-4cb4-9d3e-44ee25f973eb}quot; Name=quot;Created_x0020_Byquot; Hidden=quot;FALSEquot; /> <!-- Created_x0020_By --> </FieldRefs> <XmlDocuments> <XmlDocument NamespaceURI=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;> <FormTemplates xmlns=quot;http://schemas.microsoft.com/sharepoint/v3/contenttype/formsquot;> <Display>DocumentLibraryForm</Display> <Edit>DocumentLibraryForm</Edit> <New>DocumentLibraryForm</New> </FormTemplates> </XmlDocument> </XmlDocuments> </ContentType> ... Omitted for brevity ... <ContentType ID=quot;0x0120quot; Name=quot;$Resources:Folderquot; Group=quot;$Resources:Folder_Content_Typesquot; Description=quot;$Resources:FolderCTDescquot; Sealed=quot;TRUEquot; Version=quot;0quot;> <FieldRefs>
  • 8. Lab 12: Using Features to Provision Sites <FieldRef ID=quot;{fa564e0f-0c70-4ab9-b863-0177e6ddd247}quot; Name=quot;Titlequot; Required=quot;FALSEquot; Hidden=quot;TRUEquot;/> <!-- Title --> <FieldRef ID=quot;{8553196d-ec8d-4564-9861-3dbe931050c8}quot; Name=quot;FileLeafRefquot; Hidden=quot;FALSEquot;/> <!-- FileLeafRef --> </FieldRefs> </ContentType> ... Omitted for brevity ... </Elements> Exercise 5 Check the state of the HOL Feature site prior to installing the new Library Feature In this exercise you will check the current state of the HOL Feature sire you created in exercise 4. You will notice that their will be only one Document Library (Shared Documents) currently available. 1. Launch IE and navigate to the HOL Feature site located at “http://hol.litwareinc.com/sitedirectory/HOL Feature”. 2. Click on “View All Site Content” located on the top left navigation element and notice the site has only one Shared Documents library under the Document Libraries section. 3. Keep your web browser on this page. Exercise 6 Install the HOLLibrary feature In this exercise you will create and install a new feature (HOLLibrary) which will create the HOL Library document library. This library is a simple reuse of the standard Document Library (via copy-paste-rename) installed with Windows SharePoint Services 3.0. Using the functionality of Features, we will create an instance of a Document Library and a Content Type of “HOL Document” which will then be included in the root of the site on which we activate our feature on. ∑ Install the feature 1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking the shortcut found on the desktop.
  • 9. Lab 12: Using Features to Provision Sites 9 2. Navigate to the Feature directory by issuing the following command “cd HOLFeatures” if not already there. 3. Copy the HOLLibrary feature to the server with the following command: “xcopy HOLLibrary quot;C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATEFEATURESHOLLibraryquot; /s /y” 4. Install the feature to the server with the following command: “stsadm -o installfeature -filename HOLLibraryfeature.xml” 5. Activate the feature for the Feature team site with the following command: “stsadm -o activatefeature -filename HOLLibraryfeature.xml -url http://hol.litwareinc.com/SiteDirectory/HOLFeature” 6. The HOL Library Feature has been successfully installed. To verify this, refresh the All Content page of the “HOL Feature” site. Click on the “HOL Library” document library and then click the down arrow beside New. You should have a new document type called “HOL Document”. Exercise 7 Review the different elements that compose the HOLSimpleFormToolBar Feature In this exercise we will review a feature that installs “Custom Actions” for the standard Announcements list that navigates to a custom web part page also installed by this feature. ∑ Review the Feature 1. Open “C:HOLFeaturesHOLSimpleFormToolbar” directory and review the files included in this feature. 2. Open “C:HOLFeaturesHOLSimpleFormToolbarfeature.xml”. The “feature.xml” file content is listed below: 3. Notice the ElementManifest that points to the next important files for parsing elements.xml and ElementFile. The ElementFile points to our custom web part page sampleurl.aspx. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Feature Id=quot;72A67618-42FA-4dbb-A6F8-566EF1393F18quot; Title=quot;New Simple Form ToolBar Buttonquot; Scope=quot;Webquot; xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <ElementManifests> <ElementManifest Location=quot;elements.xmlquot; />
  • 10. Lab 12: Using Features to Provision Sites <ElementFile Location=quot;sampleurl.aspxquot; /> </ElementManifests> </Feature> 4. Open “C:HOLFeaturesHOLSimpleFormToolbarelements.xml”. The contents are shown below. Notice the CustomAction tags that create two toolbar buttons and an admin page link that point to our custom page sampleurl.aspx. Additionally, notice that the Module section is used to provision our custom web part page at the root of the site. <?xml version=quot;1.0quot; encoding=quot;utf-8quot; ?> <!-- _lcid=quot;1033quot; _version=quot;12.0.0.4407quot; _dal=quot;1quot; --> <!-- _LocalBinding --> <Elements xmlns=quot;http://schemas.microsoft.com/sharepoint/quot;> <CustomAction Title=quot;Simple (Display)quot; Id=quot;Simple Toolbar (Display)quot; Sequence=quot;100quot; RegistrationType=quot;Listquot; RegistrationId=quot;104quot; Location=quot;DisplayFormToolbarquot;> <UrlAction Url=quot;sampleurl.aspx?id={ItemId}quot; /> </CustomAction> <CustomAction Title=quot;Simple (Edit)quot; Id=quot;Simple Toolbar (Edit)quot; Sequence=quot;110quot; RegistrationType=quot;Listquot; RegistrationId=quot;104quot; Location=quot;EditFormToolbarquot;> <UrlAction Url=quot;sampleurl.aspxquot; /> </CustomAction> <CustomAction Title=quot;Simple Pagequot; Id=quot;Simple Settings Pagequot; Sequence=quot;50quot; GroupId=quot;SiteAdministrationquot; Location=quot;Microsoft.SharePoint.SiteSettingsquot; Rights=quot;ManageListsquot;> <UrlAction Url=quot;sampleurl.aspxquot; /> </CustomAction> <Module Name=quot;SamplePagequot; Url=quot;quot; Path=quot;quot;> <File Url=quot;sampleurl.aspxquot; /> </Module> </Elements> 5. Open “C:HOLFeaturesHOLSimpleFormToolbarsampleurl.aspx”. The “samplerurl.aspx” file content is listed below:
  • 11. Lab 12: Using Features to Provision Sites 11 Notice that the <script> block which simply renders our Announcements list in a list box. Additionally, notice the asp:Content tags that are used to layout our page utilizing the ASP.NET 2.0 Master Pages functionality. <%@ Page language=quot;C#quot; MasterPageFile=quot;~masterurl/default.masterquot; Inherits=quot;Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Versi on=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429cquot; %> <%@ Register Tagprefix=quot;SharePointquot; Namespace=quot;Microsoft.SharePoint.WebControlsquot; Assembly=quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429cquot; %> <%@ Register Tagprefix=quot;Utilitiesquot; Namespace=quot;Microsoft.SharePoint.Utilitiesquot; Assembly=quot;Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429cquot; %> <%@ Import Namespace=quot;Microsoft.SharePointquot; %> <asp:Content ContentPlaceHolderId=quot;PlaceHolderPageTitlequot; runat=quot;serverquot;></asp:Content> <asp:Content ContentPlaceHolderId=quot;PlaceHolderAdditionalPageHeadquot; runat=quot;serverquot;></asp:Content> <asp:Content ContentPlaceHolderId=quot;PlaceHolderPageImagequot; runat=quot;serverquot;></asp:Content> <asp:Content ContentPlaceHolderId=quot;PlaceHolderPageTitleInTitleAreaquot; runat=quot;serverquot;> Announcements List via Code </asp:Content> <asp:Content ContentPlaceHolderId=quot;PlaceHolderPageDescriptionquot; runat=quot;serverquot;></asp:Content> <asp:Content ContentPlaceHolderId=quot;PlaceHolderMainquot; runat=quot;serverquot;> <asp:ListBox ID=quot;AnnouncementsListquot; runat=quot;serverquot; /> <script language=quot;C#quot; runat=server> protected override void OnLoad(EventArgs e) { if (!this.IsPostBack) { // Get the announcements list SPWeb web = SPContext.GetContext(this.Context).Web; SPList list = web.GetListFromUrl(quot;Lists/Announcements/AllItems.aspxquot;); // populate the list box with values from it SPDataSource dataSource = new SPDataSource(); dataSource.List = list; this.AnnouncementsList.DataSource = dataSource; this.AnnouncementsList.DataTextField = quot;Titlequot;; this.AnnouncementsList.DataValueField = quot;Titlequot;; this.AnnouncementsList.DataBind(); } base.OnLoad(e); } </script> </asp:Content>
  • 12. Lab 12: Using Features to Provision Sites Exercise 8 Install the HOLSimpleFormToolBar feature In this exercise you will install the HOLSimpleFormToolBar feature. This feature adds a button at three different locations a) on the announcement itself b) the “Announcement” list and c) in the “Site Administration” section. ∑ Install the HOLSimpleFormToolBar feature 1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking the shortcut found on the desktop. 2. Navigate to the Feature directory by issuing the following command “cd HOLFeatures” 3. Copy the HOLLibrary feature to the server with the following command: “xcopy HOLSimpleFormToolBar quot;C:Program FilesCommon FilesMicrosoft Shared web server extensions12TEMPLATEFEATURESHOLSimpleFormToolBarquot; /s /y” 4. Install the feature to the server with the following command: “stsadm -o installfeature -filename HOLSimpleFormToolBarfeature.xml” 5. Activate the feature for the Feature team site with the following command: “stsadm -o activatefeature -filename HOLSimpleFormToolBarfeature.xml -url http://hol.litwareinc.com/siteDirectory/HOLFeature” 6. The HOLSimpleFormToolBar Feature has been successfully installed. To verify this installation, Open IE and navigate to the “HOL Feature” site at “http://hol.litwareinc.com/sitedirectory/HOLFeature” and click the “Get Started with Windows SharePoint Services!” link under Announcements 7. Note the Simple (Display) button on the toolbar. Click the “Simple(Display)” link Notice that you are taken to the sample page included in your HOLSimpleFormToolBar feature. This page displays all the announcements in the site in a multi-select form field.
  • 13. Lab 12: Using Features to Provision Sites 13 8. Return to the “HOL Feature” site home page. 9. Click on the “Annoucements” link 10. Mouse over the accouncement and click the down arrow and select “Edit Item” from the “Get Started with Windows SharePoint Services!” action menu. 11. Notice the Simple (Edit) button on the toolbar. Click that link. Note that you are again taken to the same sample page included in our feature.
  • 14. Lab 12: Using Features to Provision Sites 12. Return to the “HOL Feature” site home page. 13. Go to the site settings page by clicking on “Site Settings” from the “Site Actions” menu. 14. Notice the “Simple Page” link in the “Site Administration” section. Click that link 15. You are again taken to the same sample page included in our feature.
  • 15. Lab 12: Using Features to Provision Sites 15 16. Return to the “HOL Feature” site home page. You have now installed and tested three powerful customizations addressing specific needs of site Administrators and content contributors. Exercise 9 Deactivate a Feature In this exercise you will deactivate (remove) the toolbar buttons and Site Administration option. ∑ Deactivate feature 1. Open an “Office 12 Command Prompt”, if not already opened, by double-clicking the shortcut found on the desktop. 2. Navigate to the Feature directory by issuing the following command “cd HOLFeatures” You do not need to uninstall the feature for it to no longer be avaialble to the site. The deactivatefeature command remove all components of the feature. Issue the following command and check if the buttons and option under the Site Administration are still available. They should not be! 3. Deactivate the feature for the HOLFeature team site with the following command: “stsadm -o deactivatefeature -filename HOLSimpleFormToolBarfeature.xml - url http://hol.litwareinc.com/siteDirectory/HOLFeature” 4. Verify that all buttons are no longer available and that the Site Administration “Simple Page” was removed. Lab Completed!