Moss나 asp.net 웹 어플리케이션 등과 같은 Windows 통합 인증을 필요로 하는 사이트에 들어 갈려면 매번 인증창이 나타나 많이 귀찮죠.. ( 도메인 로그온 되어 있는 상태라면 열외~).

원래 이런 윈도우 통합 인증은 OS의 크리덴셜 메니저(credential manager)를 통해서 쉽게 관리 될 수 있습니다.
아래처럼 등록하면 매번 인증하지 않고 바로 들어 갈 수 있습니다.

물론 API도 제공 되기 때문에 프로그램적으로 등록할 수도 있구요.

관리자 명령 프롬프트에서

cmdkey /? 을 쳐보시기 바랍니다. 친절하게 등록하는 도움말이 나옵니다.


Examples:
  To list available credentials:
     cmdkey /list
     cmdkey /list:targetname
  To create domain credentials:
     cmdkey /add:targetname /user:username /pass:password
     cmdkey /add:targetname /user:username /pass
     cmdkey /add:targetname /user:username
     cmdkey /add:targetname /smartcard
  To create generic credentials:
     The /add switch may be replaced by /generic to create generic credentials
  To delete existing credentials:
     cmdkey /delete:targetname
  To delete RAS credentials:
     cmdkey /delete /ras


예를 들어  http://sps.moss.com 이라는 사이트를 등록 할려면 아래와 같이 하면 됩니다.
cmdkey /add:sps.moss.com  /user:domain\userid /pass:password 

그리고 반듯이 해당 사이트를 IE의 신뢰할 수 있는 사이트 등록해야 합니다.
또한,  신뢰할 수 있는 사이트 영역에서 사용자 인증을 "현재 사용자 이름 및 암호를 사용하여 자동으로 로그온"으로 선택합니다.(기본값)






만약, 호스트 파일에  호스명과 사이트명이 다를 경우에 모두 등록합니다.

211.241.xxx.xxx sps-dev, sps.mossdev.com

cmdkey /add:sps-dev /user:domain\userid /pass:password 
cmdkey /add:sps.mossdev.com /User:domain\userid /pass:password 





 

SharePoint 2010으로 배포 후에 바로 반영이 잘되지 않죠. 그래서 일단 캐시를 지웁니다.
그래도 안될때가 있다는....헐~~

그래서 IE8의 경우 F12로 개발자 도구를 열어서 매번 아래 매뉴를 지겨우도록 클릭합니다.

캐시 - 브라우저 캐시 지우기
캐시 - 이 도메인에 대해 브라우저 캐시 지우기

그런데, 최근에...아래처럼..[항상 서버에서 새로 고침]만 선택되어져 있으면 항상 서버에서 받아온다는 것을 알았습니다. 

그래서 배포 후에 브라우저만 새로 고침만 하면 됩니다...
별거 아닌것 같지만 같은 동작을 반복적으로 하면....많이 짜증나죠...~~

그리고, 현재 작업하고 잇는 브라우저를 닫았다면 브라우저를 열때 마다 다시 설정해주야야 합니다.




VisualStudio 2010에서 Silverlight 컨트롤을 포함하는 VisualWebPart에서 실버라이트 컨트롤을 디버깅하는 방법입니다.

1. VisualStudio 2010 - debug - Attach to Process.... 메뉴를 선택합니다.

2. Attach To Process 화면에서 Select.. 을 선택해서 "Silverlight" 를 체크합니다.

3. Available Processes에서 iexplorer.exe에서 debugging Silverlight webPart.... 을 지정합니다.

4. 즐~~ 디버깅.~~~



SPTreeView 을 ascx의 비하인드(Behind) 코드의 Page_Load 이벤트에서 TreeNode만 생성하면 알아서 뿌려주겠지 생각했는데.. 왠걸 아무 반응도 없다는....

한참 해메다가...( 윈도우 어플만 5년하다가 웹을 할려니 적응 힘드네...헐)
아무튼,  ascx의 OnPreRender 을 오버라이드(override) 에서 코드를 작성하니 잘 되더군요.

OnPreRender 이벤트는 말 그대로 랜더링 되기 전에 이벤트이구요.

아래 내용은 위 내용을 찾다고 검색질 해서 퍼온 문서입니다.
원래는 
Visual Web Parts 내용을 주로 다루고 있는데, 고건 별 내용은 없구요..


Demo outline

In this demo you will go through tasks required to create a SharePoint Project Items like Web parts and Visual Web Parts using the SharePoint Tools templates.

The provided sample code is the final solution that will be created during this demo. Also, this demo project is based on the SharePoint Tools Project template demo included in this Training Kit.

Run Source\Setup\Setup.bat to create the required SharePoint site for this demo.

Steps:

1.       Open the MetroWebParts project and inspect the existing items. If required, set the Site Url property of the project in the Properties window.

2.       Add the Images SharePoint mapped folder to the project by right-clicking on the project node and selecting the Add SharePoint “Images” Mapped Folder.

a.       This will automatically create the MetroWebParts folder.

b.      Right-click on the MetroWebParts folder and select Add Existing Item and select, from the Assets folder of this demo, the FeatureIcon.gif and WebPartIcon.gif image files.

3.       Open the feature included in the Features folder by right-clicking on it and opening the Feature designer.

a.       In the Properties window, edit the image Url property and set it to MetroWebParts\FeatureIcon.gif to use the recently added image file.

4.       Add a new SharePoint Web Part by right-clicking on the project node and using the Add New item context menu.

a.       Edit the elements.xml and change the Group property of the File element to something more meaningful like “MetroWebParts”

b.      Edit the .webpart file of the Web Part and modify the Title and Description properties.

c.       Include the ChromeType, CatalogIconImageUrl and TitleIconImageUrl properties.

<property name="ChromeType" type="chrometype">TitleAndBorder</property>

<property name="CatalogIconImageUrl" type="string">_layouts/images/MetroWebParts/WebPartIcon.gif</property>

<property name="TitleIconImageUrl" type="string">_layouts/images/MetroWebParts/WebPartIcon.gif</property>

 

5.       Add a new SharePoint Visual Web Part by right-clicking on the project node and using the Add New Item context menu.

a.       Do the same as with the Web Part previously created.

·   Edit elements.xml file, edit .webpart file modifying existing properties and adding new properties

b.      Add a SharePoint TreeView to the user control included in the template. (Code Snippets at the end of the current file)

c.       Override and Implement the OnPreRender method to load the TreeView with the hierarchical virtual file system for the current site. (Code Snippets at the end of the current file)

d.      Import the Microsoft.Sharepoint namespace in the user control’s class if required.

6.       Change the Active Deployment Configuration to No Activation using the SharePoint tab in the Project properties page.

a.       Right-click the MetroWebParts project node and click Deploy. Review the Output window to see the details.

7.       Open Internet Explorer and browse to the configured SharePoint site’s home page. For example http://localhost/sites/SharePointToolsDemo

8.       Activate the feature in the Site by using the Site Settings - Site Collection Administration page in SharePoint. Deactivate the feature first if it is already activated.

9.       Using the Page ribbon in the site’s home page to use the Edit Page command and add a new web part.

a.       Select the MetroWebParts category and check the two created Web Parts are present.

b.      Add both web parts and the use the Stop Editing command to check the new site’s home page look and feel.

 

<SharePoint:SPTreeView ID="treeSiteFiles" runat="server" ImageSet="XPFileExplorer" NodeIndent="15">

  <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />

  <NodeStyle Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black" HorizontalPadding="2px"

    NodeSpacing="0px" VerticalPadding="2px" />

  <ParentNodeStyle Font-Bold="False" />

  <SelectedNodeStyle BackColor="#B5B5B5" Font-Underline="False" HorizontalPadding="0px"

    VerticalPadding="0px" />

</SharePoint:SPTreeView>

 

C#

const string SITE_IMG = @"\_layouts\images\FPWEB16.GIF";

const string FOLDER_IMG = @"\_layouts\images\FOLDER16.GIF";

const string GHOSTED_FILE_IMG = @"\_layouts\images\NEWDOC.GIF";

const string UNGHOSTED_FILE_IMG = @"\_layouts\images\RAT16.GIF";

 

protected override void OnPreRender(EventArgs e)

{

    treeSiteFiles.Nodes.Clear();

    SPWeb site = SPContext.Current.Web;

    SPFolder rootFolder = site.RootFolder;

    TreeNode rootNode = new TreeNode(site.Url, site.Url, SITE_IMG);

    LoadFolderNodes(rootFolder, rootNode);

    treeSiteFiles.Nodes.Add(rootNode);

    treeSiteFiles.ExpandDepth = 1;

}

 

protected void LoadFolderNodes(SPFolder folder, TreeNode folderNode)

{

    foreach (SPFolder childFolder in folder.SubFolders)

    {

        TreeNode childFolderNode = new TreeNode(childFolder.Name, childFolder.Name, FOLDER_IMG);

        childFolderNode.NavigateUrl = SPContext.Current.Site.MakeFullUrl(childFolder.Url);

        LoadFolderNodes(childFolder, childFolderNode);

        folderNode.ChildNodes.Add(childFolderNode);

    }

 

    foreach (SPFile file in folder.Files)

    {

        TreeNode fileNode;

        if (file.CustomizedPageStatus == SPCustomizedPageStatus.Uncustomized)

        {

            fileNode = new TreeNode(file.Name, file.Name, GHOSTED_FILE_IMG);

        }

        else

        {

            fileNode = new TreeNode(file.Name, file.Name, UNGHOSTED_FILE_IMG);

        }

 

        fileNode.NavigateUrl = SPContext.Current.Site.MakeFullUrl(file.Url);

        folderNode.ChildNodes.Add(fileNode);

    }

}

Visual Basic

Const SITE_IMG As String = "\_layouts\images\FPWEB16.GIF"

Const FOLDER_IMG As String = "\_layouts\images\FOLDER16.GIF"

Const GHOSTED_FILE_IMG As String = "\_layouts\images\NEWDOC.GIF"

Const UNGHOSTED_FILE_IMG As String = "\_layouts\images\RAT16.GIF"

 

Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)

    treeSiteFiles.Nodes.Clear()

    Dim site = SPContext.Current.Web

    Dim rootFolder = site.RootFolder

    Dim rootNode = New TreeNode(site.Url, site.Url, SITE_IMG)

    LoadFolderNodes(rootFolder, rootNode)

    treeSiteFiles.Nodes.Add(rootNode)

    treeSiteFiles.ExpandDepth = 1

End Sub

 

Protected Sub LoadFolderNodes(ByVal folder As SPFolder, ByVal folderNode As TreeNode)

    For Each childFolder As SPFolder In folder.SubFolders

        Dim childFolderNode = New TreeNode(childFolder.Name, childFolder.Name, FOLDER_IMG)

        childFolderNode.NavigateUrl = SPContext.Current.Site.MakeFullUrl(childFolder.Url)

        LoadFolderNodes(childFolder, childFolderNode)

        folderNode.ChildNodes.Add(childFolderNode)

    Next

 

    For Each file As SPFile In folder.Files

        Dim fileNode As TreeNode

        If (file.CustomizedPageStatus = SPCustomizedPageStatus.Uncustomized) Then

            fileNode = New TreeNode(file.Name, file.Name, GHOSTED_FILE_IMG)

        Else

            fileNode = New TreeNode(file.Name, file.Name, UNGHOSTED_FILE_IMG)

        End If

 

        fileNode.NavigateUrl = SPContext.Current.Site.MakeFullUrl(file.Url)

        folderNode.ChildNodes.Add(fileNode)

    Next

End Sub

 




요새 SharePoint 2010을 스터디하고 있는 데 도움일 될 수 있을 것 같아서 올렸습니다.



SharePoint: Annotated Minimal Master Page

Yet another minimal master page!

There are a number of “minimal master pages” on the web:

I created this one for my SharePoint Designer class to both highlight the sections (the <h3> tags) and to document optional vs. required sections.

 

You can download this file from here.

<!-- Optional DOCTYPE -->
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>

<!-- Tags needed by SharePoint and ASP.Net -->
<%@Master language="C#"%>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
<%@ Register TagPrefix="wssuc" TagName="DesignModeConsole" src="~/_controltemplates/DesignModeConsole.ascx" %>

<!-- Standard HTML tag with optional text direction "dir=" (Left to Right vs Right to Left for multilingual sites - More info: http://www.w3.org/TR/REC-html40/struct/dirlang.html#h-8.2 -->
<HTML dir="<%$Resources:wss,multipages_direction_dir_value%>" runat="server" xmlns:o="urn:schemas-microsoft-com:office:office" __expr-val-dir="ltr">

<HEAD runat="server">

        <!-- common meta tags - optional, but you should at least keep the "Expires" to control browser caching -->
    <META Name="GENERATOR" Content="Microsoft SharePoint">
    <META Name="progid" Content="SharePoint.WebPartPage.Document">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
    <META HTTP-EQUIV="Expires" content="0">

    <!-- optional - generates this: <META NAME="ROBOTS" CONTENT="NOHTMLINDEX"/> based on options set in Site Actions, Site Settings, Search Visibility -->
    <SharePoint:RobotsMetaTag runat="server"/>

        <!-- Page title as supplied from the content page's ASP:Content tag -->       
    <Title ID=onetidTitle>
        <asp:ContentPlaceHolder id=PlaceHolderPageTitle runat="server"/>
    </Title>

        <!-- these two tags are found in non-publishing sites and load the CSS in the expected order -->
            <!-- this loads CORE.CSS and is not need if you are creating your own CSS -->
            <Sharepoint:CssLink runat="server"/>
            <!-- this loads the theme select by the user in Site Settings and is not need if you are creating your own CSS -->
            <SharePoint:Theme runat="server"/>
            <!-- your CSS links can go here -->
            <!-- <link rel="stylesheet" type="text/css" href="yourstylesheet" /> -->
        <!-- A publishing master page uses both Sharepoint.CssLink and SsharePoint:CssRegistration controls
            to load style sheets.
          Note: The CssLink control will render all of the CssRegistration CSS files in alphabetical order (!)
                and then follow with CORE.CSS - This might not be what you expected!   
        -->

    <!-- Renders a link to a JavaScript library used by SharePoint -->
    <SharePoint:ScriptLink language="javascript" name="core.js" Defer="true" runat="server"/>
    <!-- Renders a link to a custom JavaScript URL defined in onet.xml (if present) -->
    <SharePoint:CustomJSUrl runat="server"/>
    <!-- optional - Renders path to .disco file for clients like VS2005 to discover web services on the server -->
    <SharePoint:SoapDiscoveryLink runat="server"/>
    <!-- this lets content pages load additional style sheets, javascript, meta tags etc -->
    <asp:ContentPlaceHolder id="PlaceHolderAdditionalPageHead" runat="server">
    </asp:ContentPlaceHolder>

    <!-- optional this lets installed "Features" load additional style sheets, javascript, meta tags etc -->
    <SharePoint:DelegateControl runat="server" ControlId="AdditionalPageHead" AllowMultipleControls="true"/>

</HEAD>

<!-- the onload runs javascript needed for master pages - scroll is optional -->
<BODY scroll="yes" onload="javascript:if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();">

    <!-- form required for all ASPX pages -->
    <form runat="server" onsubmit="return _spFormOnSubmitWrapper();">

        <!-- required to support web parts -->
        <WebPartPages:SPWebPartManager id="m" runat="Server"/>

<h3>Typical top of page items</h3>
        <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigation" runat="server">
        <!-- common controls for the top of a site -->
            <!-- global breadcrumb trail -->
            <asp:ContentPlaceHolder id="PlaceHolderGlobalNavigationSiteMap" runat="server">
                <asp:SiteMapPath SiteMapProvider="SPSiteMapProvider" id="GlobalNavigationSiteMap" RenderCurrentNodeAsLink="true" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/>
            </asp:ContentPlaceHolder>
            <!-- optional - renders the variations link -->
            <SharePoint:DelegateControl runat="server" ControlId="GlobalSiteLink0"/>
            <!-- optional - renders the MySite link -->
            <SharePoint:DelegateControl ControlId="GlobalSiteLink1" Scope="Farm" runat="server"/>
            <!-- optional - renders the MyLinks menu -->
            <SharePoint:DelegateControl ControlId="GlobalSiteLink2" Scope="Farm" runat="server"/>
            <!-- optional - renders the Welcome menu -->
            <wssuc:Welcome id="explitLogout" runat="server"/>
            <!-- optional help button -->
            <a href="javascript:TopHelpButtonClick('NavBarHelpHome')" AccessKey="<%$Resources:wss,multipages_helplink_accesskey%>" id="TopHelpLink" title="<%$Resources:wss,multipages_helplinkalt_text%>" runat="server">
            <img align='absmiddle' border=0 src="/_layouts/images/helpicon.gif" alt="<%$Resources:wss,multipages_helplinkalt_text%>" runat="server">
            </a>
        &nbsp;&nbsp;&nbsp;&nbsp;</asp:ContentPlaceHolder>

<hr>
<h3>Typical top of page site / page header items - Site Logo, Title etc.</h3>

        <!-- Typical Site Header items - Title, Logo, etc -->

        <!-- optional - site logo from Site Settings -->
        <SharePoint:SiteLogoImage id="onetidHeadbnnr0" LogoImageUrl="/_layouts/images/titlegraphic.gif" runat="server"/>

        <!-- site title from site settings - place holder is required, SPLinkButton and ProjectProperty are optional  -->   
        <asp:ContentPlaceHolder id="PlaceHolderSiteName" runat="server">
            <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/" id="onetidProjectPropertyTitle">
                <SharePoint:ProjectProperty Property="Title" runat="server" />
            </SharePoint:SPLinkButton>
        </asp:ContentPlaceHolder>

<hr>
<h3>Search controls</h3>

        <!-- Search controls - placeholder is required -->
        <asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
            <!-- optional - default content for search - actual search depends on content page and / or Site Settings, Search Settings (to turn on advanced search)-->
            <SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
        </asp:ContentPlaceHolder>

<!-- ------------------------------------------   -->

    <!-- required placeholder - this typically wraps the entire top navigation -->
    <asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">

<hr>
<h3>Typical tab navigation</h3>

        <!-- Tab bar -->
        <!-- required placeholder -->
        <asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">

            <!-- ASP.Menu based SharePoint menu - lots of customization possibilities here -->
            <SharePoint:AspMenu
              ID="TopNavigationMenu"
              Runat="server"
              DataSourceID="topSiteMap"
              EnableViewState="false"
              AccessKey="<%$Resources:wss,navigation_accesskey%>"
              Orientation="Horizontal"
              StaticDisplayLevels="2"
              MaximumDynamicDisplayLevels="1"
              DynamicHorizontalOffset="0"
              StaticPopoutImageUrl="/_layouts/images/menudark.gif"
              StaticPopoutImageTextFormatString=""
              DynamicHoverStyle-BackColor="#CBE3F0"
              SkipLinkText=""
              StaticSubMenuIndent="0"
              CssClass="ms-topNavContainer">
                <StaticMenuStyle/>
                <StaticMenuItemStyle CssClass="ms-topnav" ItemSpacing="0px"/>
                <StaticSelectedStyle CssClass="ms-topnavselected" />
                <StaticHoverStyle CssClass="ms-topNavHover" />
                <DynamicMenuStyle  BackColor="#F2F3F4" BorderColor="#A7B4CE" BorderWidth="1px"/>
                <DynamicMenuItemStyle CssClass="ms-topNavFlyOuts"/>
                <DynamicHoverStyle CssClass="ms-topNavFlyOutsHover"/>
                <DynamicSelectedStyle CssClass="ms-topNavFlyOutsSelected"/>
            </SharePoint:AspMenu>
            <SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource">
                <Template_Controls>
                    <asp:SiteMapDataSource
                      ShowStartingNode="False"
                      SiteMapProvider="SPNavigationProvider"
                      id="topSiteMap"
                      runat="server"
                      StartingNodeUrl="sid:1002"/>
                </Template_Controls>
            </SharePoint:DelegateControl>
        </asp:ContentPlaceHolder>
<hr>

<h3>Site actions menu</h3>

        <!-- optional - Site Actions Menu -->
        <SharePoint:SiteActions runat="server" AccessKey="<%$Resources:wss,tb_SiteActions_AK%>" id="SiteActionsMenuMain"
            PrefixHtml="&lt;div&gt;&lt;div&gt;"
            SuffixHtml="&lt;/div&gt;&lt;/div&gt;"
            MenuNotVisibleHtml="&amp;nbsp;">
            <CustomTemplate>
            <SharePoint:FeatureMenuTemplate runat="server"
                FeatureScope="Site"
                Location="Microsoft.SharePoint.StandardMenu"
                GroupId="SiteActions"
                UseShortId="true"
                >
                <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Create"
                    Text="<%$Resources:wss,viewlsts_pagetitle_create%>"
                    Description="<%$Resources:wss,siteactions_createdescription%>"
                    ImageUrl="/_layouts/images/Actionscreate.gif"
                    MenuGroupId="100"
                    Sequence="100"
                    UseShortId="true"
                    ClientOnClickNavigateUrl="~site/_layouts/create.aspx"
                    PermissionsString="ManageLists, ManageSubwebs"
                    PermissionMode="Any" />
                <SharePoint:MenuItemTemplate runat="server" id="MenuItem_EditPage"
                    Text="<%$Resources:wss,siteactions_editpage%>"
                    Description="<%$Resources:wss,siteactions_editpagedescription%>"
                    ImageUrl="/_layouts/images/ActionsEditPage.gif"
                    MenuGroupId="100"
                    Sequence="200"
                    ClientOnClickNavigateUrl="javascript:MSOLayout_ChangeLayoutMode(false);"
                    />
                <SharePoint:MenuItemTemplate runat="server" id="MenuItem_Settings"
                    Text="<%$Resources:wss,settings_pagetitle%>"
                    Description="<%$Resources:wss,siteactions_sitesettingsdescription%>"
                    ImageUrl="/_layouts/images/ActionsSettings.gif"
                    MenuGroupId="100"
                    Sequence="300"
                    UseShortId="true"
                    ClientOnClickNavigateUrl="~site/_layouts/settings.aspx"
                    PermissionsString="EnumeratePermissions,ManageWeb,ManageSubwebs,AddAndCustomizePages,ApplyThemeAndBorder,ManageAlerts,ManageLists,ViewUsageData"
                    PermissionMode="Any" />
            </SharePoint:FeatureMenuTemplate>
            </CustomTemplate>
        </SharePoint:SiteActions>

        </asp:ContentPlaceHolder>

<hr>
<h3>Edit Consoles - Edit page, etc...</h3>

    <!-- Edit Page -->
    <asp:ContentPlaceHolder ID="WSSDesignConsole" runat="server">
        <wssuc:DesignModeConsole id="IdDesignModeConsole" runat="server"/>
    </asp:ContentPlaceHolder>
    <!-- Publishing site console -->
    <asp:ContentPlaceHolder ID="SPNavigation" runat="server">
        <SharePoint:DelegateControl runat="server" ControlId="PublishingConsole"
           PrefixHtml="&lt;tr&gt;&lt;td colspan=&quot;4&quot; id=&quot;mpdmconsole&quot; class=&quot;ms-consolemptablerow&quot;&gt;"
           SuffixHtml="&lt;/td&gt;&lt;/tr&gt;">
        </SharePoint:DelegateControl>
    </asp:ContentPlaceHolder>

<hr>
<h3>Typical Page Header</h3>

    <!-- Page Image -->
    <asp:ContentPlaceHolder id="PlaceHolderPageImage" runat="server"/>

    <!-- Breadcrumb trail for sub pages -->
    <asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
        <asp:SiteMapPath SiteMapProvider="SPContentMapProvider" id="ContentMap" SkipLinkText="" NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/> &nbsp;
    </asp:ContentPlaceHolder>
    <!-- Page Title -->
    <asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
    <!-- Mini Console  -->
    <asp:ContentPlaceHolder id="PlaceHolderMiniConsole" runat="server"/>

<hr>
<h3>Typical Left Navigation</h3>

    <!-- Left navigation data source -->
    <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarDataSource" runat="server" />
    <!-- Calendar date picker area - used by calendar views -->
    <asp:ContentPlaceHolder id="PlaceHolderCalendarNavigator" runat="server" />
    <!-- Quick Launch area including View All Site Content and Recycle bin -->
    <asp:ContentPlaceHolder id="PlaceHolderLeftNavBar" runat="server">

        <!-- View All Site Content -->
        <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">
            <SharePoint:SPLinkButton id="idNavLinkViewAll" runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" Text="<%$Resources:wss,quiklnch_allcontent%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
        </SharePoint:SPSecurityTrimmedControl>
        <!-- Quick Launch menu -->
        <Sharepoint:SPNavigationManager
            id="QuickLaunchNavigationManager"
            runat="server"
            QuickLaunchControlId="QuickLaunchMenu"
            ContainedControl="QuickLaunch"
            EnableViewState="false">
            <SharePoint:DelegateControl runat="server" ControlId="QuickLaunchDataSource">
                <Template_Controls>
                <asp:SiteMapDataSource SiteMapProvider="SPNavigationProvider" ShowStartingNode="False" id="QuickLaunchSiteMap" StartingNodeUrl="sid:1025" runat="server" />
             </Template_Controls>
            </SharePoint:DelegateControl>
            <SharePoint:AspMenu id="QuickLaunchMenu" DataSourceId="QuickLaunchSiteMap" runat="server" Orientation="Vertical" StaticDisplayLevels="2" ItemWrap="true" MaximumDynamicDisplayLevels="0" StaticSubMenuIndent="0" SkipLinkText="">
                <LevelMenuItemStyles>
                    <asp:menuitemstyle CssClass="ms-navheader" />
                    <asp:menuitemstyle CssClass="ms-navitem" />
                </LevelMenuItemStyles>
                <LevelSubMenuStyles>
                    <asp:submenustyle CssClass="ms-navSubMenu1" />
                    <asp:submenustyle CssClass="ms-navSubMenu2" />
                </LevelSubMenuStyles>
                <LevelSelectedStyles>
                    <asp:menuitemstyle CssClass="ms-selectednavheader" />
                    <asp:menuitemstyle CssClass="ms-selectednav" />
                </LevelSelectedStyles>
            </SharePoint:AspMenu>
        </Sharepoint:SPNavigationManager>
        <!--- Tree View - display controled in Site Settings, Tree view --->   
        <Sharepoint:SPNavigationManager
            id="TreeViewNavigationManager"
            runat="server"
            ContainedControl="TreeView">
            <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchy" Text="<%$Resources:wss,treeview_header%>" AccessKey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>
            <SharePoint:SPHierarchyDataSourceControl
             runat="server"
             id="TreeViewDataSource"
             RootContextObject="Web"
             IncludeDiscussionFolders="true"
            />
            <SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScroll" onscroll="javascript:_spRecordScrollPositions(this);" Style="overflow: auto;height: 400px;width: 150px; ">
            <Sharepoint:SPTreeView
                id="WebTreeView"
                runat="server"
                ShowLines="false"
                DataSourceId="TreeViewDataSource"
                ExpandDepth="0"
                SelectedNodeStyle-CssClass="ms-tvselected"
                NodeStyle-CssClass="ms-navitem"
                NodeStyle-HorizontalPadding="2"
                SkipLinkText=""
                NodeIndent="12"
                ExpandImageUrl="/_layouts/images/tvplus.gif"
                CollapseImageUrl="/_layouts/images/tvminus.gif"
                NoExpandImageUrl="/_layouts/images/tvblank.gif"
            >
            </Sharepoint:SPTreeView>
            </Sharepoint:SPRememberScroll>
        </Sharepoint:SPNavigationManager>
        <!-- Recycle Bin -->
        <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems"/>

    </asp:ContentPlaceHolder>

<hr>
<h3>Left Actions Area (used by wikis)</h3>

<!-- Left Actions area placeholder - used by Wikis-->
<asp:ContentPlaceHolder id="PlaceHolderLeftActions" runat="server"/>

<hr>
<h3>Page Content</h3>

    <!-- This div wraps the content area and is used by SharePoint to
    display the web part editor panel to the right of the web part zones -->

    <div id="MSO_ContentDiv" runat="server">
        <A name="mainContent"></A>
        <!-- Page Description -->
        <asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>
        <!-- Main content area -->
        <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server">
        </asp:ContentPlaceHolder>
    </div>

<hr>
<h3>Form Digest Security Control (not visible)</h3>
<!-- Form Digest Security Control -->
<asp:ContentPlaceHolder id="PlaceHolderFormDigest" runat="server">
    <SharePoint:FormDigest runat=server/>
</asp:ContentPlaceHolder>

<input type="text" name="__spDummyText1" style="display:none;" size=1/>
<input type="text" name="__spDummyText2" style="display:none;" size=1/>
</form>

<hr>
<h3>Other required placeholders not generally needed by a custom master page</h3>

<!-- Footer -->
<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server"/>
<!-- Used to add body styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderBodyAreaClass" runat="server"/>
<!-- Used to add styles to the page header -->
<asp:ContentPlaceHolder id="PlaceHolderTitleAreaClass" runat="server"/>

    <asp:Panel visible="false" runat="server">
    <!-- PLACE UNUSED CONTENT PLACEHOLDERS HERE -->
    <!--- --- Placeholders used in default.master that you will likely not use --- --->
    <!-- Area between page image and page title -->
    <asp:ContentPlaceHolder id="PlaceHolderTitleLeftBorder" runat="server"/>
    <!-- Area between page name and right page border -->
    <asp:ContentPlaceHolder id="PlaceHolderTitleRightMargin" runat="server"/>
    <!-- Area between top nav bar and page content -->
    <asp:ContentPlaceHolder id="PlaceHolderTitleAreaSeparator" runat="server"/>
    <!-- Area above left nav bar -->
    <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarTop" runat="server"/>
    <!-- Sets a width of the left nav bar -->
    <asp:ContentPlaceHolder id="PlaceHolderNavSpacer" runat="server"><IMG SRC="/_layouts/images/blank.gif" width=138 height=1 alt=""></asp:ContentPlaceholder>
    <!-- Area between left nav bar and page content -->
    <asp:ContentPlaceHolder id="PlaceHolderLeftNavBarBorder" runat="server"></asp:ContentPlaceHolder>
    <!-- Area between left nav and content -->
    <asp:ContentPlaceHolder id="PlaceHolderBodyLeftBorder" runat="server"/>
    <!-- Area between content and right page border -->
    <asp:ContentPlaceHolder id="PlaceHolderBodyRightMargin" runat="server"/>
    </asp:Panel>

</BODY>
</HTML>

1 1



1. Field 재정의 및 재지정

필요에 따라서 기존 필드를 사용하거나, 기존의 필드 타입을 재정의할 수 있다.

<Fields>

<Field ID="{7662cd2c-f069-4dba-9e35-082cf976e170}" Type="Note" RichText="TRUE" RichTextMode="FullHtml" IsolateStyles="TRUE" NumLines="15" Name="Body" DisplayName="$Resources:core,camlid2;" Sortable="FALSE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="Body" >
</Field>

이미 정의되어 있는 Note라는 필드타입으로 "Body"라는 필드를 생성한다. 새로 생성한 것이므로 ID는 새로운 Guid을 부여한다.  


<Field ID="{8DFFC782-F4E8-44E9-8777-25ECDC3DF816}" Type="Custom001FieldType" Name="Custom001Field" StaticName="Custom001Field"DisplayName="사용자 필드001" SourceID="http://schemas.microsoft.com/sharepoint/v3" Description="" Group="EPIENCE" >
</Field

Custom001FieldType 라는 필드타입을 정의하고, 타입으로 새로운 필드 Custom001Field 생성한다. 참조 : Custom Field 만들기 참조

</Fields>

차이점은 전자는 기존의 필드타입(Sharepoint 2010 에서 제공하는) 으로 필드를 생성하는 것이고, 
후자는 새 필드타입(Field Type)을 정의해서 필드를 생성하는 것이다.

2.필드 참조 및 사용

이제 사용할 필드을 앞 단계에서 생성해으니, 실제 리스트에서 필드를 사용할 수 있게 정의(참조) 해주어야 한다. 리스트는 ContentType을 정의해서 사용할 필드를 지정하므로 ContentType Tag 부분에서 설정한다.
여기서 정의한 필드는 양식(Forms tag)에서 정의한 aspx 페이지에서 필드값을 표시/저장/편집할 수 있다.


<ContentType ID="0x01040094203F6B465E4fb2AF061B6CB96B3DDB" Group="EPIENCE" Name="EPIENCE_BOARD" Sealed="FALSE" Version="0"> 

<FieldRefs>

<FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" DisplayName="제목"/>
☞ ContentType을 이미 정의된 ContentType에서 상속받은 경우 부모의 필드를 그대로 사용한다.     (샘플은 공지사항을 이어받은 것임.)

<FieldRef ID="{8DFFC782-F4E8-44E9-8777-25ECDC3DF816}" Name="Custom001Field" DisplayName="사용자필드001" /> 
☞ Custom Field 사용.

</FieldRefs>

</ContentType>

3. View에서의 표시할 필드(Field) 표시

뷰에 표시할 필드을 FieldRef Tag로 지정한다.

<
Views>

……

<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">

<ViewFields>

<FieldRef Name="LinkTitle"> </FieldRef> <!-- 공지 사항 ContentType에서 정의된 필드 연결 -->
<FieldRef Name="Attachments"></FieldRef>
<FieldRef Name="Custom001Field"></FieldRef>
☞ 뷰에서 보여줄 필드 연결

</ViewFields>

</View>
……

</Views>




1. SPFieldText(또는 다른 베이스 클래스)로부터 상속받은 새로운 클래스 파일 생성
   
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SK.EPIENCE.FieldType
{
    /// <summary>
    /// 필드 타입 정의
    /// </summary>
    public class Custom001FieldType : SPFieldText
    {
        public Custom001FieldType(SPFieldCollection fields, string fieldName)
            :base(fields, fieldName)
        {
            this.ShowInDisplayForm = false; //
        }

        public Custom001FieldType(SPFieldCollection fields, string typeName, string displayName)
            : base(fields, typeName, displayName)
        {
            this.ShowInDisplayForm = false; //
        }

        public override BaseFieldControl FieldRenderingControl
        {
            get
            {              
               BaseFieldControl fieldControl = new Custom001FieldTypeControl();
               fieldControl.FieldName = InternalName;
               return fieldControl;
            }
        }      
    }

    /// <summary>
    /// 필드 구현(Page상에 값을 래던링) 필요에 따라 메쏘드를 override 해서 사용
    /// </summary>
    public class Custom001FieldTypeControl : TextField
    {
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
         }

        public override string Text
        {
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    base.Text = value + " ...";
                }
                else
                {
                    base.Text = value;
                }
            }
        }

        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
         }
    }
}

2. 필드 정의에 관련된 XML File  생성

<?xml version="1.0" encoding="utf-8"?>

<FieldTypes>

  <FieldType>

    <Field Name="TypeName">Custom001FieldType </Field>

    <Field Name="ParentType">Text</Field>

    <Field Name="TypeDisplayName">Custom Name Field</Field>

    <Field Name="TypeShortDescription">Custom Name Text Field</Field>

    <Field Name="UserCreatable">TRUE</Field>

    <Field Name="ShowOnListCreate">TRUE</Field>

    <Field Name="ShowOnSurveyCreate">TRUE</Field>

    <Field Name="ShowOnDocumentLibrary">TRUE</Field>

    <Field Name="ShowOnColumnTemplateCreate">TRUE</Field>

    <Field Name="Sortable">TRUE</Field>

    <Field Name="Filterable">TRUE</Field>

    <Field Name="FieldTypeClass">SK.EPIENCE.FieldType, Custom001FieldType , Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx</Field>

     </FieldType>

</FieldTypes>

3. 커스텀 필드가  있는  dll을  GAC 등록 또는 bin 디렉토리에 복사
4. ListTemplate 정의시에 참조해서 사용.



1. 모스
설정

     a. 기본 인증인 Windows 통합 인증 Web Application 대응하는 확장 Web Application 생성한다.(같은 포트도 사용 가능하다)

     b. ASP.NET membership Database 생성

    %System Drive%\Windows\Microsoft.NET\Framework\v2.0 디렉토리의 aspnet_regsql.exe 싱행해서 membership Database 생성

    MembershipSeede Tool 사용해 데스트 사용자 생성 (http://www.codeplex.com/CKS/Release/ProjectReleases.aspx?ReleaseId=7450 에서 다운로드)

      c. WebConfig 설정

    멤버 검색을 위한 와일드 문자열 등록

    <PeoplePickerWildcards>
     
    <clear />
     
    <add key="AspNetSqlMembershipProvider" value="%" />
     
    <add key="fbaMembers" value="%" />
    </PeoplePickerWildcards>

     

    DB연결설정

    <connectionStrings>
     
    <add name="fbaSQL" connectionString="data source=MOSSSUDEAN\OfficeServers;database=aspnetdb;user=sa2;password=Walkman;"

    providerName="System.Data.SqlClient" />

    </connectionStrings>

     

    인증 멤버십 등록

    <system.web>

    <membership defaultProvider="fbaMembers">
     
    <providers>
        <add connectionStringName="fbaSQL" applicationName="/"
          name="fbaMembers"
          type="System.Web.Security.SqlMembershipProvider, System.Web,
          Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
     
    </providers>
    </membership>
    <roleManager enabled="true" defaultProvider="fbaRoles">
     
    <providers>
        <add connectionStringName="fbaSQL" applicationName="/"
          name="fbaRoles" type="System.Web.Security.SqlRoleProvider, System.Web,
          Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
     
    </providers>
    </roleManager>
    ……………

     

    ## 모두 3군데의 Web Application Web.Config 수정해야 한다.

    확장서버는 위와 같이 처리하면 되고, 기본 Windows 인증과 Web Application 중앙관리 Web.Config  Role 부분에서 아래와 같이 주어야 한다.

    <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">

     

    1. 모스 중앙관리에서 확장서버의 extranet 설정

    인증타입, Membership Provider, Role Manager 등록

    1. 중앙관리의 응용프로그램 정책에서 확장서버를 위한 사용자 등록(관리자 역할)

     

     

  1. .net Web Application 설정
    1. 어플리케이션 생성함.
    2. Web.Config 설정

    <connectionStrings>

    <add name="fbaSQL" connectionString="data source=MOSSSUDEAN\OfficeServers;database=aspnetdb;user=sa2;password=Walkman;" providerName="System.Data.SqlClient" />

    </connectionStrings> 

    <system.web>

    <membership defaultProvider="fbaMembers">

    <providers>

    <add connectionStringName="fbaSQL" applicationName="/" name="fbaMembers" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    </providers>

    </membership>

    <roleManager enabled="true" defaultProvider="fbaRoles">

    <providers>

    <add connectionStringName="fbaSQL" applicationName="/" name="fbaRoles" type="System.Web.Security.SqlRoleProvider, System.Web,Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    </providers>

    </roleManager>

     

    <authentication mode="Forms">  부분은 모스 확장 서버것을 복사해서 붙이면 .

    <forms loginUrl="/_layouts/login.aspx" />

    </authentication>

    <identity impersonate="true" />

    <authorization>

    <deny users="?" />

    </authorization>

     

    1. Moss 확장 서버의 _Layouts 폴더 아래에 .net Web Application 추가하고 Form 인증으로 방식을 변경한다.

     

TAG Moss