tag:blogger.com,1999:blog-72654463478792075342024-02-20T03:46:52.822+02:00Islam Khattab's Sharepoint BlogTalking about different subjects in SharePoint 2010 and 2013Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-7265446347879207534.post-42792583820442202772017-08-31T01:15:00.003+02:002017-08-31T01:16:35.878+02:00Azure AD PowerShell Management Agent for B2B users<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="-webkit-text-size-adjust: 100%; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 15px; margin-bottom: 16px;">
<br />
<br />
<div role="main" style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px;">
<div itemscope="" itemtype="http://schema.org/SoftwareSourceCode" style="box-sizing: border-box;">
<div data-pjax-container="" id="js-repo-pjax-container" style="box-sizing: border-box;">
<div class="container new-discussion-timeline experiment-repo-nav" style="box-sizing: border-box; margin-left: auto; margin-right: auto; width: 980px;">
<div class="repository-content" style="box-sizing: border-box;">
<div class="file" style="border-radius: 3px; border: 1px solid rgb(221, 221, 221); box-sizing: border-box; margin-bottom: 16px; margin-top: 16px; position: relative;">
<div class="readme blob instapaper_body" id="readme" style="box-sizing: border-box;">
<br />
<article class="markdown-body entry-content" itemprop="text" style="background-color: white; border-radius: 0px; border: 0px; box-sizing: border-box; font-size: 16px; line-height: 1.5; padding: 45px; word-wrap: break-word;"><h1 style="border-bottom: 1px solid rgb(234, 236, 239); box-sizing: border-box; font-size: 2em; line-height: 1.25; margin-bottom: 16px; margin-left: 0px; margin-right: 0px; margin-top: 0px !important; padding-bottom: 0.3em;">
Azure AD PowerShell Managment Agent</h1>
<div style="box-sizing: border-box; margin-bottom: 16px;">
Full Code on : https://github.com/islamkhattab/AzurePSMA</div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
This is a custom MIM Managment agent to import Azure AD users using Msol module,users could be either Member or Guest (B2B), then send them back in SharePoint 2016 User Profiles</div>
<div style="box-sizing: border-box; margin-bottom: 16px;">
This agent is tested on the following scenario:</div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">SharePoint 2016 On-Prem Farm (Aug 2017 PU) - With User Profile Service Configured and Syncronization Service Configured using MIM 2016</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Azure AD with Guest (B2B) users added and immutible id set</li>
</ul>
<blockquote style="border-left: 0.25em solid rgb(223, 226, 229); box-sizing: border-box; color: #6a737d; margin: 0px 0px 16px; padding: 0px 1em;">
<div style="box-sizing: border-box;">
Import PowerShell File Configurations</div>
</blockquote>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">$usersType variable - 'All' for all user types, 'Member' for Azure AD Users and 'Guest' for B2B users</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">$restrictImmutableId - Imports only users with ImmutableId property set</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">$DebugFilePath - Outputs powershell messages</li>
</ul>
<blockquote style="border-left: 0.25em solid rgb(223, 226, 229); box-sizing: border-box; color: #6a737d; margin: 0px 0px 16px; padding: 0px 1em;">
<div style="box-sizing: border-box;">
Import PowerShell File Changes</div>
</blockquote>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">You can update the properties and mappings to fit your scenario</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Any changes in the import.ps1 should reflect in the schema.ps1 file as well</li>
</ul>
<blockquote style="border-left: 0.25em solid rgb(223, 226, 229); box-sizing: border-box; color: #6a737d; margin: 0px 0px 16px; padding: 0px 1em;">
<div style="box-sizing: border-box;">
User photos is still not implemented</div>
</blockquote>
<h2 style="border-bottom: 1px solid rgb(234, 236, 239); box-sizing: border-box; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; padding-bottom: 0.3em;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#prerequisites" id="user-content-prerequisites" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Prerequisites</h2>
<h3 style="box-sizing: border-box; font-size: 1.25em; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#sharepoint-managment-agent-installed-and-configured" id="user-content-sharepoint-managment-agent-installed-and-configured" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>SharePoint Managment Agent installed and configured</h3>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;"><a href="http://krossfarm.com/?p=145" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Step by Step: Installation of Microsoft Identity Manager for SharePoint 2016 User profile Service</a></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><a href="http://krossfarm.com/?p=148" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Step by Step: Configuration of Microsoft Identity Manager for SharePoint 2016 User profile Service</a></li>
</ul>
<h3 style="box-sizing: border-box; font-size: 1.25em; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#enable-msol-on-mim-server" id="user-content-enable-msol-on-mim-server" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Enable Msol on MIM Server</h3>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Install required software These steps are required once on your computer, not every time you connect. However, you'll likely need to install newer versions of the software periodically.</li>
</ul>
<ol style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Install the 64-bit version of the Microsoft Online Services Sign-in Assistant: <a href="https://go.microsoft.com/fwlink/p/?LinkId=286152" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Microsoft Online Services Sign-in Assistant for IT Professionals RTW</a>.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Install the 64-bit version of the Windows Azure Active Directory Module for Windows PowerShell with these steps:<ol style="box-sizing: border-box; list-style-type: lower-roman; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Open the <a href="http://connect.microsoft.com/site1164/Downloads/DownloadDetails.aspx?DownloadID=59185" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Azure Active Directory Connection</a> web page.</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">In Files in Download at the bottom of the page, click Download for the AdministrationConfig-V1.1.166.0-GA.msi file, and then install it.</li>
</ol>
</li>
</ol>
<h3 style="box-sizing: border-box; font-size: 1.25em; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#store-azure-ad-global-admin-in-a-secure-file" id="user-content-store-azure-ad-global-admin-in-a-secure-file" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Store Azure AD Global Admin in a secure file</h3>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Get latest PowerShell script file from <a href="https://github.com/cunninghamp/PowerShell-Stored-Credentials" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">PowerShell-Stored-Credentials</a></li>
<li style="box-sizing: border-box; margin-top: 0.25em;">For full steps follow the following link (<a href="https://practical365.com/blog/saving-credentials-for-office-365-powershell-scripts-and-scheduled-tasks/" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">https://practical365.com/blog/saving-credentials-for-office-365-powershell-scripts-and-scheduled-tasks/</a>)</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Save the generated file i.e. <a href="mailto:azure.admin@yourdomain.onmicrosoft.com.cred" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">azure.admin@yourdomain.onmicrosoft.com.cred</a></li>
</ul>
<h3 style="box-sizing: border-box; font-size: 1.25em; line-height: 1.25; margin-bottom: 16px; margin-top: 24px;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#install-the-granfeldt-powershell-management-agent-ma" id="user-content-install-the-granfeldt-powershell-management-agent-ma" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Install The Granfeldt PowerShell Management Agent (MA)</h3>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;"><a href="https://github.com/sorengranfeldt/psma" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Full GitHub Repo</a></li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><a href="https://github.com/sorengranfeldt/psma/wiki/Installing" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">Installation Steps</a></li>
</ul>
<h2 style="border-bottom: 1px solid rgb(234, 236, 239); box-sizing: border-box; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; padding-bottom: 0.3em;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#azureadpsma-installation" id="user-content-azureadpsma-installation" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>AzureADPSMA Installation</h2>
<blockquote style="border-left: 0.25em solid rgb(223, 226, 229); box-sizing: border-box; color: #6a737d; margin: 0px 0px 16px; padding: 0px 1em;">
<div style="box-sizing: border-box;">
Before Begining, Please first read <a href="https://blog.darrenjrobinson.com/how-to-create-an-azuread-microsoft-identity-manager-management-agent-using-the-ms-graphapi-and-differential-queries/" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">How to create an AzureAD Microsoft Identity Manager Management Agent using the MS GraphAPI and Differential Queries</a>, to get overview of the idea we are intoducing here as it is based on the same idea</div>
</blockquote>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Create a folder 'AzurePSADMA' for example that will contain mainly the following files</li>
</ul>
<table style="border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; display: block; margin-bottom: 16px; margin-top: 0px; overflow: auto; width: 888px;"><thead style="box-sizing: border-box;">
<tr style="border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><th style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">File Name</th><th style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Description</th></tr>
</thead><tbody style="box-sizing: border-box;">
<tr style="border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Import.ps1</td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">The main import sequence script</td></tr>
<tr style="background-color: #f6f8fa; border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;"><a href="mailto:azure.admin@yourdomain.onmicrosoft.com.cred" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;">azure.admin@yourdomain.onmicrosoft.com.cred</a></td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Azure Admin Cred file</td></tr>
<tr style="border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Password.ps1</td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Password PowerShell File, You must have a Password.ps1 file. Even though we’re not doing password management on this MA, the PS MA configuration requires a file for this field. The .ps1 doesn’t need to have any logic/script inside it. It just needs to be present</td></tr>
<tr style="background-color: #f6f8fa; border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Export.ps1</td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Export PowerShell File, You must have a Export.ps1 file. Even though we’re not doing Export on this MA, the PS MA configuration requires a file for this field. The .ps1 doesn’t need to have any logic/script inside it. It just needs to be present</td></tr>
<tr style="border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Functions-PSStoredCredentials.ps1</td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Creditial Manager</td></tr>
<tr style="background-color: #f6f8fa; border-top: 1px solid rgb(198, 203, 209); box-sizing: border-box;"><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">Schema.ps1</td><td style="border: 1px solid rgb(223, 226, 229); box-sizing: border-box; padding: 6px 13px;">The schema of the AzureADUser that will be imported to MIM</td></tr>
</tbody></table>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;"><div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
Management Agent Configuration</div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">With the Granfeldt PowerShell Management Agent installed on your FIM/MIM Synchronisation Server, in the Synchronisation Server Manager select Create Management Agent and choose "PowerShell" from the list of Management Agents to create. As this example is for Users, I’ve named my MA accordingly "AzureADUsers"</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/3ed6806b96d599d6f58476521951ac8b233cbe31/68747470733a2f2f3266673171712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d3936766f36634f7336474130325770444c543643356f51524f6d70643141395956523974335f42593958456e655f45553454654131536d4d526d4546452d474d4932696d3076766665584f546538796968545f6661756137594d5472324756637142392d714970455677396f68577a483232554e5735594a5f304247395f3941755f4942446c6a5063344b3366364e4a787349413349575179526f47577834526c54524d5f5839543552356c4d784b564e65757866516f2d656b4e7a73683569366e6e614b682d7562476b43426d44534d45593978673f77696474683d363636266865696768743d3530312663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://2fg1qq.bn1303.livefilestore.com/y4m96vo6cOs6GA02WpDLT6C5oQROmpd1A9YVR9t3_BY9XEne_EU4TeA1SmMRmEFE-GMI2im0vvfeXOTe8yihT_faua7YMTr2GVcqB9-qIpEVw9ohWzH22UNW5YJ_0BG9_9Au_IBDljPc4K3f6NJxsIA3IWQyRoGWx4RlTRM_X9T5R5lMxKVNeuxfQo-ekNzsh5i6nnaKh-ubGkCBmDSMEY9xg?width=666&height=501&cropmode=none" src="https://camo.githubusercontent.com/3ed6806b96d599d6f58476521951ac8b233cbe31/68747470733a2f2f3266673171712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d3936766f36634f7336474130325770444c543643356f51524f6d70643141395956523974335f42593958456e655f45553454654131536d4d526d4546452d474d4932696d3076766665584f546538796968545f6661756137594d5472324756637142392d714970455677396f68577a483232554e5735594a5f304247395f3941755f4942446c6a5063344b3366364e4a787349413349575179526f47577834526c54524d5f5839543552356c4d784b564e65757866516f2d656b4e7a73683569366e6e614b682d7562476b43426d44534d45593978673f77696474683d363636266865696768743d3530312663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">For the schema script add your schema.ps1 file full path and the azure ad amdin account, the password will not be used from this screen as well use the stored cred file instead</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/9b1fd9b4c418e4f24159fbb69f6283f55f792b47/68747470733a2f2f326668726b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5359676c6772364c536d2d70385254437057695254414a4f414f6e3932574c4d443863412d6f5f6d6e756a704e36746d4b77506e66773246725039634a703542686d495646504d334b325739754d383450564754716e74772d416358753562646278526f66785347593973577253465863797564754b7863776d462d6254514f727777454459623838394744737367314f695853644333634a6b3738656c7a4f30723849357830736d694f746861664f442d714462782d6f4a694c3474372d436e41494d4d624376487a44626a6e6f74735f677946413f77696474683d363634266865696768743d3439382663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://2fhrkg.bn1303.livefilestore.com/y4mSYglgr6LSm-p8RTCpWiRTAJOAOn92WLMD8cA-o_mnujpN6tmKwPnfw2FrP9cJp5BhmIVFPM3K2W9uM84PVGTqntw-AcXu5bdbxRofxSGY9sWrSFXcyuduKxcwmF-bTQOrwwEDYb889GDssg1OiXSdC3cJk78elzO0r8I5x0smiOthafOD-qDbx-oJiL4t7-CnAIMMbCvHzDbjnots_gyFA?width=664&height=498&cropmode=none" src="https://camo.githubusercontent.com/9b1fd9b4c418e4f24159fbb69f6283f55f792b47/68747470733a2f2f326668726b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5359676c6772364c536d2d70385254437057695254414a4f414f6e3932574c4d443863412d6f5f6d6e756a704e36746d4b77506e66773246725039634a703542686d495646504d334b325739754d383450564754716e74772d416358753562646278526f66785347593973577253465863797564754b7863776d462d6254514f727777454459623838394744737367314f695853644333634a6b3738656c7a4f30723849357830736d694f746861664f442d714462782d6f4a694c3474372d436e41494d4d624376487a44626a6e6f74735f677946413f77696474683d363634266865696768743d3439382663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Paths to the Import, Export and Password scripts. Note: the Export and Password PS1 scripts files exist but are empty.</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/dca137391b28747eddd58cf7ebf4c8cccaf5b136/68747470733a2f2f32666a7168712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5835577a63737379645677715f3633366f453250306d754b675f476666476233677336356d2d69775a635843564b65546d575f36464e69535550394c6234475162493232703748466949477676746a344e53416a4d4755425073653944334a30754e314a426a5a573139633347665057446365655a6f7774676b4935696e7a576451364e6f532d4c62643066634b6572734a68523761645873634476497a52307962574f646d33497a63496a3234516b46464a717353733146393076415155514d507a75626661662d6959586c6a7171793737544b513f77696474683d363636266865696768743d3530312663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://2fjqhq.bn1303.livefilestore.com/y4mX5WzcssydVwq_636oE2P0muKg_GffGb3gs65m-iwZcXCVKeTmW_6FNiSUP9Lb4GQbI22p7HFiIGvvtj4NSAjMGUBPse9D3J0uN1JBjZW19c3GfPWDceeZowtgkI5inzWdQ6NoS-Lbd0fcKersJhR7adXscDvIzR0ybWOdm3IzcIj24QkFFJqsSs1F90vAQUQMPzubfaf-iYXljqqy77TKQ?width=666&height=501&cropmode=none" src="https://camo.githubusercontent.com/dca137391b28747eddd58cf7ebf4c8cccaf5b136/68747470733a2f2f32666a7168712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5835577a63737379645677715f3633366f453250306d754b675f476666476233677336356d2d69775a635843564b65546d575f36464e69535550394c6234475162493232703748466949477676746a344e53416a4d4755425073653944334a30754e314a426a5a573139633347665057446365655a6f7774676b4935696e7a576451364e6f532d4c62643066634b6572734a68523761645873634476497a52307962574f646d33497a63496a3234516b46464a717353733146393076415155514d507a75626661662d6959586c6a7171793737544b513f77696474683d363636266865696768743d3530312663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Object Type as configured in the Schema.ps1 file.</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/ba4aedbe3a110f4dd42370eadbd087cc5f518ef9/68747470733a2f2f706f727968712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d7558646d727578575549705330796739646d4d2d4968694f4a654e6a6a5f51657631514b5166424333537579316861746f4341796752536d4d5f73596e32384f31666450524a537262724561614e4f5550594d47766944542d5a32386734635f72536764697230486b4864694e4c4d437a7334416c3271736a53752d5843476858454b6c70453833615139423158345a4e48724a564c4b5142744c365079476845714c366a44544d4d784d727a4a5768316153667172415579755452484a594f38654a397442536a6f3053454b62384163725f796d773f77696474683d363636266865696768743d3530302663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://poryhq.bn1303.livefilestore.com/y4muXdmruxWUIpS0yg9dmM-IhiOJeNjj_Qev1QKQfBC3Suy1hatoCAygRSmM_sYn28O1fdPRJSrbrEaaNOUPYMGviDT-Z28g4c_rSgdir0HkHdiNLMCzs4Al2qsjSu-XCGhXEKlpE83aQ9B1X4ZNHrJVLKQBtL6PyGhEqL6jDTMMxMrzJWh1aSfqrAUyuTRHJYO8eJ9tBSjo0SEKb8Acr_ymw?width=666&height=500&cropmode=none" src="https://camo.githubusercontent.com/ba4aedbe3a110f4dd42370eadbd087cc5f518ef9/68747470733a2f2f706f727968712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d7558646d727578575549705330796739646d4d2d4968694f4a654e6a6a5f51657631514b5166424333537579316861746f4341796752536d4d5f73596e32384f31666450524a537262724561614e4f5550594d47766944542d5a32386734635f72536764697230486b4864694e4c4d437a7334416c3271736a53752d5843476858454b6c70453833615139423158345a4e48724a564c4b5142744c365079476845714c366a44544d4d784d727a4a5768316153667172415579755452484a594f38654a397442536a6f3053454b62384163725f796d773f77696474683d363636266865696768743d3530302663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Attributes as configured in the Schema.ps1 file</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/de3a3989bacf7912e031c6e9096bf6ede88ca3da/68747470733a2f2f706f733971612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6777565f396d324f47364b4a506c74643178374a783970786a586b4133665432796b707365455158576677466b4c377a6356596f5068485079703971474878504678764a6a7561347376635f71705f544a70766459526e656b6a344952364d36466d416449435a39375a732d657a58737362745a57572d5750524e4174387641474276774174422d526e49453850544156334b58487778635a4975436a3477387a2d59553842337747766459694c2d3155795531514a6e46654c7634536c6975484f484a6173626838394b646d462d545f58455748673f77696474683d363635266865696768743d3439392663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://pos9qa.bn1303.livefilestore.com/y4mgwV_9m2OG6KJPltd1x7Jx9pxjXkA3fT2ykpseEQXWfwFkL7zcVYoPhHPyp9qGHxPFxvJjua4svc_qp_TJpvdYRnekj4IR6M6FmAdICZ97Zs-ezXssbtZWW-WPRNAt8vAGBvwAtB-RnIE8PTAV3KXHwxcZIuCj4w8z-YU8B3wGvdYiL-1UyU1QJnFeLv4SliuHOHJasbh89KdmF-T_XEWHg?width=665&height=499&cropmode=none" src="https://camo.githubusercontent.com/de3a3989bacf7912e031c6e9096bf6ede88ca3da/68747470733a2f2f706f733971612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6777565f396d324f47364b4a506c74643178374a783970786a586b4133665432796b707365455158576677466b4c377a6356596f5068485079703971474878504678764a6a7561347376635f71705f544a70766459526e656b6a344952364d36466d416449435a39375a732d657a58737362745a57572d5750524e4174387641474276774174422d526e49453850544156334b58487778635a4975436a3477387a2d59553842337747766459694c2d3155795531514a6e46654c7634536c6975484f484a6173626838394b646d462d545f58455748673f77696474683d363635266865696768743d3439392663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Anchor as per the Schema.ps1 file.</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/45bdd511845b34657af5fec257c3a8f063c89ae6/68747470733a2f2f706f71696e612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d4e4e4c454c55634b6270374530796831466c4743352d2d5a756b575932454a4d794f785652584f706a4c7333484f3646307757574c516756636d57644a45334f6b52484a32514e67766d7542656e5767617a42566e7a62324e62776b5362702d6d6a67624c66356b394f4d38694e514565776a53794b7543535f4679394566756854424b484f6b4b4f747168473357495347714f63424b3169556373366952575f6a394c73413961536d336c7a524743655644367430555f2d356378576d656b44423957564a4957334c336d72676d75635f56505f513f77696474683d363636266865696768743d3530302663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://poqina.bn1303.livefilestore.com/y4mNNLELUcKbp7E0yh1FlGC5--ZukWY2EJMyOxVRXOpjLs3HO6F0wWWLQgVcmWdJE3OkRHJ2QNgvmuBenWgazBVnzb2NbwkSbp-mjgbLf5k9OM8iNQEewjSyKuCS_Fy9EfuhTBKHOkKOtqhG3WISGqOcBK1iUcs6iRW_j9LsA9aSm3lzRGCeVD6t0U_-5cxWmekDB9WVJIW3L3mrgmuc_VP_Q?width=666&height=500&cropmode=none" src="https://camo.githubusercontent.com/45bdd511845b34657af5fec257c3a8f063c89ae6/68747470733a2f2f706f71696e612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d4e4e4c454c55634b6270374530796831466c4743352d2d5a756b575932454a4d794f785652584f706a4c7333484f3646307757574c516756636d57644a45334f6b52484a32514e67766d7542656e5767617a42566e7a62324e62776b5362702d6d6a67624c66356b394f4d38694e514565776a53794b7543535f4679394566756854424b484f6b4b4f747168473357495347714f63424b3169556373366952575f6a394c73413961536d336c7a524743655644367430555f2d356378576d656b44423957564a4957334c336d72676d75635f56505f513f77696474683d363636266865696768743d3530302663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Project the output to person object</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/e37db23920aec5933b83d9f150afb1aa6e399b3f/68747470733a2f2f3266696d70672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d445a7553506357782d54524666536a326e36434578557630355838506a424d7771374c47334f75374f37356458786b4c6753324a2d49795f724c5a5a5935534439417469326a366f4553636d6f617a4f68477768714a776e4d4a4f69733266335a65726b68493653695a6d515f2d4f317a4a446155334171716277626e6e7656684b64786d45624f4363536c305a747771706b4f754f61722d497834726c6261753946767239664f742d464b4d326a576768545970374e375947765071626a314433664b4a59354f4b66726b6c6c4757316b654f38513f77696474683d363638266865696768743d3439382663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://2fimpg.bn1303.livefilestore.com/y4mDZuSPcWx-TRFfSj2n6CExUv05X8PjBMwq7LG3Ou7O75dXxkLgS2J-Iy_rLZZY5SD9Ati2j6oEScmoazOhGwhqJwnMJOis2f3ZerkhI6SiZmQ_-O1zJDaU3AqqbwbnnvVhKdxmEbOCcSl0ZtwqpkOuOar-Ix4rlbau9Fvr9fOt-FKM2jWghTYp7N7YGvPqbj1D3fKJY5OKfrkllGW1keO8Q?width=668&height=498&cropmode=none" src="https://camo.githubusercontent.com/e37db23920aec5933b83d9f150afb1aa6e399b3f/68747470733a2f2f3266696d70672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d445a7553506357782d54524666536a326e36434578557630355838506a424d7771374c47334f75374f37356458786b4c6753324a2d49795f724c5a5a5935534439417469326a366f4553636d6f617a4f68477768714a776e4d4a4f69733266335a65726b68493653695a6d515f2d4f317a4a446155334171716277626e6e7656684b64786d45624f4363536c305a747771706b4f754f61722d497834726c6261753946767239664f742d464b4d326a576768545970374e375947765071626a314433664b4a59354f4b66726b6c6c4757316b654f38513f77696474683d363638266865696768743d3439382663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 0px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Configure Attribute flow</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
<a href="https://camo.githubusercontent.com/e808f2344f9b0432abc87870afd67c470cf214f1/68747470733a2f2f32666a786d712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6e4253685645557979674750724a373573722d6f4f7747493731466a725949544358644d507573675351784a49472d75664a496a65654653746e64354b6235364a6268316f55494b376c566d6e6f6f756671614a4a516671334c636f3571724e634f4e3243384c396e4a317555384251514c6d4e737735377030616679566a61556d2d534b424d4b63784f316662666b504c612d467035393752556250337363617739364c6644617a6645374a617a4a596e756e3864506248745369704b424e4d7337625853764f5965546d5249694866435f366c413f77696474683d393537266865696768743d3730352663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://2fjxmq.bn1303.livefilestore.com/y4mnBShVEUyygGPrJ75sr-oOwGI71FjrYITCXdMPusgSQxJIG-ufJIjeeFStnd5Kb56Jbh1oUIK7lVmnooufqaJJQfq3Lco5qrNcON2C8L9nJ1uU8BQQLmNsw57p0afyVjaUm-SKBMKcxO1fbfkPLa-Fp597RUbP3scaw96LfDazfE7JazJYnun8dPbHtSipKBNMs7bXSvOYeTmRIiHfC_6lA?width=957&height=705&cropmode=none" src="https://camo.githubusercontent.com/e808f2344f9b0432abc87870afd67c470cf214f1/68747470733a2f2f32666a786d712e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6e4253685645557979674750724a373573722d6f4f7747493731466a725949544358644d507573675351784a49472d75664a496a65654653746e64354b6235364a6268316f55494b376c566d6e6f6f756671614a4a516671334c636f3571724e634f4e3243384c396e4a317555384251514c6d4e737735377030616679566a61556d2d534b424d4b63784f316662666b504c612d467035393752556250337363617739364c6644617a6645374a617a4a596e756e3864506248745369704b424e4d7337625853764f5965546d5249694866435f366c413f77696474683d393537266865696768743d3730352663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
</li>
<li style="box-sizing: border-box; margin-top: 0.25em;"><div style="box-sizing: border-box; margin-bottom: 16px; margin-top: 16px;">
Add two Run Profiles to your Managment Agent [FullImport - FullSync], You can use any configurations as you needs this is just for the sake of the demo</div>
</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/5c1268423e6379a99b676873b9476c679a8a3af5/68747470733a2f2f706f736f62672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d7135484b5165665f585261524d626e4b41314b7268784558465930522d457134434e52316b7456395542575a68365539307839793348737138713742417475387a394f3041716278715647727a6e72366934563436585f4c696238596336645f726761344454695054664152764b5964376e62335835566e7266383454714530695844566e4e316951706b503262754547304b706956767a514c7a72473866325a6d63466c6d56754f55664758535a7369756c4b544c6463387347536276664a50306e376b7078473669574b5045386e37504c2d6b513f77696474683d363338266865696768743d3439312663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://posobg.bn1303.livefilestore.com/y4mq5HKQef_XRaRMbnKA1KrhxEXFY0R-Eq4CNR1ktV9UBWZh6U90x9y3Hsq8q7BAtu8z9O0AqbxqVGrznr6i4V46X_Lib8Yc6d_rga4DTiPTfARvKYd7nb3X5Vnrf84TqE0iXDVnN1iQpkP2buEG0KpiVvzQLzrG8f2ZmcFlmVuOUfGXSZsiulKTLdc8sGSbvfJP0n7kpxG6iWKPE8n7PL-kQ?width=638&height=491&cropmode=none" src="https://camo.githubusercontent.com/5c1268423e6379a99b676873b9476c679a8a3af5/68747470733a2f2f706f736f62672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d7135484b5165665f585261524d626e4b41314b7268784558465930522d457134434e52316b7456395542575a68365539307839793348737138713742417475387a394f3041716278715647727a6e72366934563436585f4c696238596336645f726761344454695054664152764b5964376e62335835566e7266383454714530695844566e4e316951706b503262754547304b706956767a514c7a72473866325a6d63466c6d56754f55664758535a7369756c4b544c6463387347536276664a50306e376b7078473669574b5045386e37504c2d6b513f77696474683d363338266865696768743d3439312663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Run AzureADUsers MA Full Import Profile</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Run AzureADUsers MA Full Sync Profile</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Run SPMA MA Full Import Profile</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Run SPMA MA Full Sync Profile</li>
<li style="box-sizing: border-box; margin-top: 0.25em;">Run SPMA MA Export Profile</li>
</ul>
<h2 style="border-bottom: 1px solid rgb(234, 236, 239); box-sizing: border-box; line-height: 1.25; margin-bottom: 16px; margin-top: 24px; padding-bottom: 0.3em;">
<a aria-hidden="true" class="anchor" href="https://github.com/islamkhattab/AzurePSMA/blob/master/README.md#verify-the-results" id="user-content-verify-the-results" style="background-color: transparent; box-sizing: border-box; color: #0366d6; float: left; line-height: 1; margin-left: -20px; padding-right: 4px; text-decoration-line: none;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z" fill-rule="evenodd"></path></svg></a>Verify the results</h2>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">After a successfull AzureADUsers MA Full import run, you should find additions according to the users type found on Azure AD</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/bd67a8acd4d39442bc40782aab561535311bc763/68747470733a2f2f706f717065772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5a5561566d617938416c64753669544c4661615a6d734f74774155305a426364354c6e4b4f424b705143364f72792d696d536455575877687a6174334945793272626e5936486f347a30555f3548526d312d4e4c635f4f4559784d533349316c6c5a7645634e78794b6177316376375633636249387148624e7a505f3852512d52566f704f6a6372717848562d5451334262567142764b7737743866527737486b5a6c466a6549782d6637586c30653469437339705571506d3834367347564235435438466542457845487a313633653452684d65413f77696474683d353930266865696768743d3339372663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://poqpew.bn1303.livefilestore.com/y4mZUaVmay8Aldu6iTLFaaZmsOtwAU0ZBcd5LnKOBKpQC6Ory-imSdUWXwhzat3IEy2rbnY6Ho4z0U_5HRm1-NLc_OEYxMS3I1llZvEcNxyKaw1cv7V3cbI8qHbNzP_8RQ-RVopOjcrqxHV-TQ3BbVqBvKw7t8fRw7HkZlFjeIx-f7Xl0e4iCs9pUqPm846sGVB5CT8FeBExEHz163e4RhMeA?width=590&height=397&cropmode=none" src="https://camo.githubusercontent.com/bd67a8acd4d39442bc40782aab561535311bc763/68747470733a2f2f706f717065772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5a5561566d617938416c64753669544c4661615a6d734f74774155305a426364354c6e4b4f424b705143364f72792d696d536455575877687a6174334945793272626e5936486f347a30555f3548526d312d4e4c635f4f4559784d533349316c6c5a7645634e78794b6177316376375633636249387148624e7a505f3852512d52566f704f6a6372717848562d5451334262567142764b7737743866527737486b5a6c466a6549782d6637586c30653469437339705571506d3834367347564235435438466542457845487a313633653452684d65413f77696474683d353930266865696768743d3339372663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">An example of user properties imported</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/2f24b2f97e2498673cb285eb7eea9280a0952e77/68747470733a2f2f706f746537772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d61365a4a385777586458437361347a47626162507651457a6137534b4d35367536586337707a7331513968527577595f5044797731654b796861586e376668772d6f753473324d396f3175675151564c6d526e4f426971457558483731774e326b365051623836577263547a6862517958664f31685046706962434c53714b526e4a49715745357250433858535876723141384a7a4c52372d5343476230435a69546c68534b5a71564b4e523054754a53303478533134533848454454546952357553535f6a6b43587a34417a5065363336466462673f77696474683d393038266865696768743d3632312663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://pote7w.bn1303.livefilestore.com/y4ma6ZJ8WwXdXCsa4zGbabPvQEza7SKM56u6Xc7pzs1Q9hRuwY_PDyw1eKyhaXn7fhw-ou4s2M9o1ugQQVLmRnOBiqEuXH71wN2k6PQb86WrcTzhbQyXfO1hPFpibCLSqKRnJIqWE5rPC8XSXvr1A8JzLR7-SCGb0CZiTlhSKZqVKNR0TuJS04xS14S8HEDTTiR5uSS_jkCXz4AzPe636Fdbg?width=908&height=621&cropmode=none" src="https://camo.githubusercontent.com/2f24b2f97e2498673cb285eb7eea9280a0952e77/68747470733a2f2f706f746537772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d61365a4a385777586458437361347a47626162507651457a6137534b4d35367536586337707a7331513968527577595f5044797731654b796861586e376668772d6f753473324d396f3175675151564c6d526e4f426971457558483731774e326b365051623836577263547a6862517958664f31685046706962434c53714b526e4a49715745357250433858535876723141384a7a4c52372d5343476230435a69546c68534b5a71564b4e523054754a53303478533134533848454454546952357553535f6a6b43587a34417a5065363336466462673f77696474683d393038266865696768743d3632312663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">After AzureADUser MA Full Sync</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/0ecac2a83734e208e3c50cb0a70cc936f5fbbe4e/68747470733a2f2f706f72667a612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6b5137464a6a71594b376f33543442576642457253573350784f4952785257534d4d414a635f426337663479305a415f5a69374c78443370426c586d477831314a477356687841306f746f783850572d387466654b62485f424461676b5966514d5064455f5141736d466a694a5079704e6e366e4469544d325a63532d63647872512d41463931465a7673733579565171724c7a76464b3538634442796543777a547869466e57736b49317970695931655f6a374f476a616f624c774b6e717745744871324662463144474e4348454962664c3743513f77696474683d353833266865696768743d3439322663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://porfza.bn1303.livefilestore.com/y4mkQ7FJjqYK7o3T4BWfBErSW3PxOIRxRWSMMAJc_Bc7f4y0ZA_Zi7LxD3pBlXmGx11JGsVhxA0otox8PW-8tfeKbH_BDagkYfQMPdE_QAsmFjiJPypNn6nDiTM2ZcS-cdxrQ-AF91FZvss5yVQqrLzvFK58cDByeCwzTxiFnWskI1ypiY1e_j7OGjaobLwKnqwEtHq2FbF1DGNCHEIbfL7CQ?width=583&height=492&cropmode=none" src="https://camo.githubusercontent.com/0ecac2a83734e208e3c50cb0a70cc936f5fbbe4e/68747470733a2f2f706f72667a612e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d6b5137464a6a71594b376f33543442576642457253573350784f4952785257534d4d414a635f426337663479305a415f5a69374c78443370426c586d477831314a477356687841306f746f783850572d387466654b62485f424461676b5966514d5064455f5141736d466a694a5079704e6e366e4469544d325a63532d63647872512d41463931465a7673733579565171724c7a76464b3538634442796543777a547869466e57736b49317970695931655f6a374f476a616f624c774b6e717745744871324662463144474e4348454962664c3743513f77696474683d353833266865696768743d3439322663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">Azure User Profile</li>
</ul>
<div style="box-sizing: border-box; margin-bottom: 16px;">
<a href="https://camo.githubusercontent.com/67b6505392322d84c4f4cd07051205fdf67f2a39/68747470733a2f2f706f726b6a772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d73687672546351526a41756133323276396e4d4b6a2d6353616146784b554457565a744d774131517741704a5f5745576c35677169726165516f6f4c346432696f786146744831337046323177667a686663396f534b6f2d4d6638357341745a7453766776447462344b534a7267574b7866484635456168677058554c376f415053316f6533786550646c656130645a586a69654a646563587a51477a35717839656446526f41454d72464f4b35643573574747584a54536e4c70733376567a4263525f314c6e7a5a5959434755664e4536377963673f77696474683d383739266865696768743d3639392663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://porkjw.bn1303.livefilestore.com/y4mshvrTcQRjAua322v9nMKj-cSaaFxKUDWVZtMwA1QwApJ_WEWl5gqiraeQooL4d2ioxaFtH13pF21wfzhfc9oSKo-Mf85sAtZtSvgvDtb4KSJrgWKxfHF5EahgpXUL7oAPS1oe3xePdlea0dZXjieJdecXzQGz5qx9edFRoAEMrFOK5d5sWGGXJTSnLps3vVzBcR_1LnzZYYCGUfNE67ycg?width=879&height=699&cropmode=none" src="https://camo.githubusercontent.com/67b6505392322d84c4f4cd07051205fdf67f2a39/68747470733a2f2f706f726b6a772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d73687672546351526a41756133323276396e4d4b6a2d6353616146784b554457565a744d774131517741704a5f5745576c35677169726165516f6f4c346432696f786146744831337046323177667a686663396f534b6f2d4d6638357341745a7453766776447462344b534a7267574b7866484635456168677058554c376f415053316f6533786550646c656130645a586a69654a646563587a51477a35717839656446526f41454d72464f4b35643573574747584a54536e4c70733376567a4263525f314c6e7a5a5959434755664e4536377963673f77696474683d383739266865696768743d3639392663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
<ul style="box-sizing: border-box; margin-bottom: 16px; margin-top: 0px; padding-left: 2em;">
<li style="box-sizing: border-box;">SharePoint 2016 on-prem User Profile</li>
</ul>
<div style="box-sizing: border-box;">
<a href="https://camo.githubusercontent.com/38a65f349713df5c8fcfecb05de2d8f7baba79d7/68747470733a2f2f706f746c61772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d3936514152326c497970754c58494c546642576a526b455f525936704e756a45684f73334d6e7750426b6a57444a6a3774567258793473735a4d677570326756375265423733314f386677676944644e69324f36523451334a6e4a5a36416f777750616b3964714d65757a3571645641446b4a7a7746596c5649387a4f51504133546478454d36424557764e58576e33775544385f6567794e726662766a5859537559384b38367a44554b4b36517066615a50524f5379584e7674355f74724d4f316d504c7336614a4e464b554965786c41736651673f77696474683d383736266865696768743d3635342663726f706d6f64653d6e6f6e65" style="background-color: transparent; box-sizing: border-box; color: #0366d6; text-decoration-line: none;" target="_blank"><img alt="picture alt" data-canonical-src="https://potlaw.bn1303.livefilestore.com/y4m96QAR2lIypuLXILTfBWjRkE_RY6pNujEhOs3MnwPBkjWDJj7tVrXy4ssZMgup2gV7ReB731O8fwgiDdNi2O6R4Q3JnJZ6AowwPak9dqMeuz5qdVADkJzwFYlVI8zOQPA3TdxEM6BEWvNXWn3wUD8_egyNrfbvjXYSuY8K86zDUKK6QpfaZPROSyXNvt5_trMO1mPLs6aJNFKUIexlAsfQg?width=876&height=654&cropmode=none" src="https://camo.githubusercontent.com/38a65f349713df5c8fcfecb05de2d8f7baba79d7/68747470733a2f2f706f746c61772e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d3936514152326c497970754c58494c546642576a526b455f525936704e756a45684f73334d6e7750426b6a57444a6a3774567258793473735a4d677570326756375265423733314f386677676944644e69324f36523451334a6e4a5a36416f777750616b3964714d65757a3571645641446b4a7a7746596c5649387a4f51504133546478454d36424557764e58576e33775544385f6567794e726662766a5859537559384b38367a44554b4b36517066615a50524f5379584e7674355f74724d4f316d504c7336614a4e464b554965786c41736651673f77696474683d383736266865696768743d3635342663726f706d6f64653d6e6f6e65" style="border-style: none; box-sizing: content-box; max-width: 100%;" /></a></div>
</article></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="footer container-lg px-3" role="contentinfo" style="box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 14px; margin-left: auto; margin-right: auto; max-width: 1012px; padding-left: 16px !important; padding-right: 16px !important;">
<div class="position-relative d-flex flex-justify-between py-6 mt-6 f6 text-gray border-top border-gray-light " style="-webkit-box-pack: justify !important; border-bottom-color: rgb(234, 236, 239) !important; border-left-color: rgb(234, 236, 239) !important; border-right-color: rgb(234, 236, 239) !important; border-top: 1px solid rgb(234, 236, 239) !important; box-sizing: border-box; color: rgb(88, 96, 105) !important; display: flex !important; font-size: 12px !important; justify-content: space-between !important; margin-top: 40px !important; padding-bottom: 40px !important; padding-top: 40px !important; position: relative !important;">
<ul class="list-style-none d-flex flex-wrap " style="box-sizing: border-box; display: flex !important; flex-wrap: wrap !important; list-style: none !important; margin-bottom: 0px; margin-top: 0px; padding-left: 0px;"></ul>
</div>
</div>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-78224156288954761742015-05-18T10:05:00.002+02:002015-05-18T10:06:46.572+02:00Automatically adding friendly Url to SharePoint Page according to its level/sub level<div dir="ltr" style="text-align: left;" trbidi="on">
<h3 style="background-color: white; color: #242424; font-size: 16px; height: auto; margin: 0.5em 0px;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Friendly URLs</span></h3>
<div style="background-color: white; color: #333333; font-size: 15px; line-height: 1.48em; margin-bottom: 1em; margin-top: 1em;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">SharePoint 2013’s friendly URLs capability is extremely straightforward in that these URLs are links that correspond directly to a term within your organization or on a particular site or page as well as correspond to your organization’s navigation term set.</span></div>
<div style="background-color: white; color: #333333; font-size: 15px; line-height: 1.48em; margin-bottom: 1em; margin-top: 1em;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The .aspx ending is no longer required after site or page name as well as the default.aspx page can be dropped from the URL's reference entirely.</span></div>
<div style="background-color: white; margin-bottom: 1em; margin-top: 1em;">
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.48em;">One of the most important point that would make you implement friendly Urls is the advantage of SEO, as now your Urls will not be like http://yourdoamain/en/MediaGallery/AlbumDetails.aspx?Id=3 , instead you will have </span><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"> </span><span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">http://yourdoamain/en/MediaGallery/Albums/season-1, Which can highly indicates the content I'll be reading in this url</span></span></div>
<h3 style="background-color: white; color: #242424; font-size: 16px; height: auto; margin: 0.5em 0px;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The issue</span></h3>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">When you enable Managed Metadata Navigation, you could have this option "Create friendly URLs for new pages automatically", This will create a Term for each page and attach this term to the Page Urls, Till this point everything is wonderful .</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyuVpO5ohKTbUq-WWyFaQYeBGjqNBS4s3yYhFm3ALS2HMaRzLQRi5MoOvdLOgacXgC-V6eegYmDYwqmFK4ltcFSAOAwIKLCNUdv741nZPyEg1RYIp3TtlvZaJZzXNj-lq_AEb28IEHWGE/s1600/2015-05-18_1105.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="65" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyuVpO5ohKTbUq-WWyFaQYeBGjqNBS4s3yYhFm3ALS2HMaRzLQRi5MoOvdLOgacXgC-V6eegYmDYwqmFK4ltcFSAOAwIKLCNUdv741nZPyEg1RYIp3TtlvZaJZzXNj-lq_AEb28IEHWGE/s640/2015-05-18_1105.png" width="640" /></a></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">This feature in action will behave in a strange way, which will give us a non desirable results, For example , let's assume having a <b>Variation site collection</b> with a <b>News</b> sub-site http://mySiteCollection/en/News, The default page for this sub-site is </span></span><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">http://mySiteCollection/en/News/Pages/default.aspx.</span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">Now we enabled the Managed Metadata Navigation to have Smart Urls, So the default page now would be connected to a Managed Navigation Term "News & Articles" , So the Url will be </span><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">http://mySiteCollection/en/news-articles.</span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">Add new Article Page under this sub-site let's say its title will be "Article 1", After the page creation you will find that the new page is attached to the parent navigation term</span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFAiV7cJu6C43l4JQTi1CRho7yI0oGfFeE3oxYF3HPd1nurKcGBQVDxINCW_JG9yc4XH4Zaq2uBSMDfIRKajI8XWOnnWalP_mla1sDBavGkcauZvuR6vlbtrAq981FlUn7giq9qNhYUP8/s1600/2015-05-18_1115.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFAiV7cJu6C43l4JQTi1CRho7yI0oGfFeE3oxYF3HPd1nurKcGBQVDxINCW_JG9yc4XH4Zaq2uBSMDfIRKajI8XWOnnWalP_mla1sDBavGkcauZvuR6vlbtrAq981FlUn7giq9qNhYUP8/s640/2015-05-18_1115.png" width="640" /></a></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div>
<br /></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">SharePoint adds new page terms to the root Term Set assigned for site navigation, no matter any level the new page has been created.</span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div>
<h3 style="background-color: white; color: #242424; font-size: 16px; height: auto; margin: 0.5em 0px;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">The Solution</span></h3>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">When creating a SharePoint page, A List Item Event Receiver could be attached to the sub-site pages library to check if the current sub-site default page is attached to a Navigation Term, If so the page event receiver will create a new Navigation Term under the default page term based on the page title as a child to maintain the same hierarchy.</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">So, In our example when creating a new page under the News sub-site, The event receiver will check the sub-site default page and will found it is attached to </span></span><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">"News & Articles" Navigation term, Then the new page navigation term will be created under this term, The result will be </span><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">http://mySiteCollection/en/news-articles/article-1</span></div>
</div>
<div>
<br /></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">This solution is easy to apply but there are some <b><u>challenges</u></b> to keep in mind:</span></span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span></div>
<div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><b>Page titles and special characters</b></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">As we are handling creating the new terms, We should handle the term friendly url segment the same way SharePoint handles it to avoid any broken urls, and to keep consistency</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">
<!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">formattedFriendlyUrlSegment</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">PageTitle.RemoveAccent();</span>
<span style="color: #d0d0d0;">friendlyUrlterm.FriendlyUrlSegment.Value</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">formattedFriendlyUrlSegment.Slugify();</span>
<span style="color: #999999; font-style: italic;">//Removes white spaces</span>
<span style="color: #6ab825; font-weight: bold;">public</span> <span style="color: #6ab825; font-weight: bold;">static</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #447fcf;">RemoveAccent</span><span style="color: #d0d0d0;">(</span><span style="color: #6ab825; font-weight: bold;">this</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">txt)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">byte</span><span style="color: #d0d0d0;">[]</span> <span style="color: #d0d0d0;">bytes</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">System.Text.Encoding.GetEncoding(</span><span style="color: #ed9d13;">"Cyrillic"</span><span style="color: #d0d0d0;">).GetBytes(txt);</span>
<span style="color: #6ab825; font-weight: bold;">return</span> <span style="color: #d0d0d0;">System.Text.Encoding.ASCII.GetString(bytes);</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">public</span> <span style="color: #6ab825; font-weight: bold;">static</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #447fcf;">Slugify</span><span style="color: #d0d0d0;">(</span><span style="color: #6ab825; font-weight: bold;">this</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">phrase)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">str</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">phrase.RemoveAccent().ToLower();</span>
<span style="color: #d0d0d0;">str</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">System.Text.RegularExpressions.Regex.Replace(str,</span> <span style="color: #ed9d13;">@"[^a-z0-9\s-]"</span><span style="color: #d0d0d0;">,</span> <span style="color: #ed9d13;">""</span><span style="color: #d0d0d0;">);</span> <span style="color: #999999; font-style: italic;">// Remove all non valid chars </span>
<span style="color: #d0d0d0;">str</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">System.Text.RegularExpressions.Regex.Replace(str,</span> <span style="color: #ed9d13;">@"\s+"</span><span style="color: #d0d0d0;">,</span> <span style="color: #ed9d13;">" "</span><span style="color: #d0d0d0;">).Trim();</span> <span style="color: #999999; font-style: italic;">// convert multiple spaces into one space </span>
<span style="color: #d0d0d0;">str</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">System.Text.RegularExpressions.Regex.Replace(str,</span> <span style="color: #ed9d13;">@"\s"</span><span style="color: #d0d0d0;">,</span> <span style="color: #ed9d13;">"-"</span><span style="color: #d0d0d0;">);</span> <span style="color: #999999; font-style: italic;">// //Replace spaces by dashes</span>
<span style="color: #6ab825; font-weight: bold;">return</span> <span style="color: #d0d0d0;">str;</span>
<span style="color: #d0d0d0;">}</span>
</span></span></pre>
</div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">
</span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span></div>
<div>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><b>Variations</b> </span></span><br />
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;">In some cases we have we needed to maintain the same term for both variation labels (Source and target) for both pages, So our plan will be to create a Term, and for each variation language will create a navigation term label to translate the term</span></span><br />
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><br /></span></span>
<span style="color: #333333; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;"><span style="font-size: 15px; line-height: 22.2000007629395px;"><b>Full Code:</b></span></span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">Here is the full code for this article </span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">
<!-- HTML generated using hilite.me --></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><span style="color: #999999; font-style: italic;">///<summary></span>
<span style="color: #999999; font-style: italic;">/// Creates a Friendly URL for a Publishing Page</span>
<span style="color: #999999; font-style: italic;">/// </summary></span>
<span style="color: #999999; font-style: italic;">/// <param name="contextWeb">SPWeb Object which contains Publishing Page</param></span>
<span style="color: #999999; font-style: italic;">/// <param name="parentName">Parent Navigation Term</param></span>
<span style="color: #999999; font-style: italic;">/// <param name="page">Publishing Page for which the Friendly URL is added</param></span>
<span style="color: #999999; font-style: italic;">/// <param name="friendlyName">Friendly Name for the Page</param></span>
<span style="color: #999999; font-style: italic;">/// <param name="AddToNavigation">Flag to indicate whether to add this Navigation Term to Quick Launch and Top Naviagation</param></span>
<span style="color: #999999; font-style: italic;">/// <returns></returns></span>
<span style="color: #6ab825; font-weight: bold;">public</span> <span style="color: #6ab825; font-weight: bold;">static</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #447fcf;">AddFriendlyUrl</span><span style="color: #d0d0d0;">(SPWeb</span> <span style="color: #d0d0d0;">contextWeb,</span> <span style="color: #d0d0d0;">PublishingPage</span> <span style="color: #d0d0d0;">page,</span> <span style="color: #6ab825; font-weight: bold;">bool</span> <span style="color: #d0d0d0;">AddToNavigation)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">return</span> <span style="color: #447fcf;">AddFriendlyUrl</span><span style="color: #d0d0d0;">(contextWeb,</span> <span style="color: #d0d0d0;">page,</span> <span style="color: #d0d0d0;">AddToNavigation,</span> <span style="color: #d0d0d0;">GetWebDefaultPageTerm(contextWeb));</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">public</span> <span style="color: #6ab825; font-weight: bold;">static</span> <span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #447fcf;">AddFriendlyUrl</span><span style="color: #d0d0d0;">(SPWeb</span> <span style="color: #d0d0d0;">contextWeb,</span> <span style="color: #d0d0d0;">PublishingPage</span> <span style="color: #d0d0d0;">page,</span> <span style="color: #6ab825; font-weight: bold;">bool</span> <span style="color: #d0d0d0;">AddToNavigation,</span> <span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #d0d0d0;">ParentNavigationTerm)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">relativeUrl</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">string</span><span style="color: #d0d0d0;">.Empty;</span>
<span style="color: #d0d0d0;">SPSecurity.RunWithElevatedPrivileges(()</span> <span style="color: #d0d0d0;">=></span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">try</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">IList<NavigationTerm></span> <span style="color: #d0d0d0;">terms</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">TaxonomyNavigation.GetFriendlyUrlsForListItem(page.ListItem,</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">// create Taxonomy Session for the context web</span>
<span style="color: #d0d0d0;">TaxonomySession</span> <span style="color: #d0d0d0;">taxonomySession</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">TaxonomyNavigation.CreateTaxonomySessionForEdit(contextWeb);</span>
<span style="color: #999999; font-style: italic;">//Page is already attached to a navigation term / Page Updated</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(terms.Count</span> <span style="color: #d0d0d0;">></span> <span style="color: #3677a9;">0</span><span style="color: #d0d0d0;">)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//already associated to Metadata navigation</span>
<span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #d0d0d0;">friendlyUrlterm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">terms[</span><span style="color: #3677a9;">0</span><span style="color: #d0d0d0;">].GetAsEditable(taxonomySession);</span>
<span style="color: #d0d0d0;">Term</span> <span style="color: #d0d0d0;">taxonomyTerm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">friendlyUrlterm.GetTaxonomyTerm(taxonomySession);</span>
<span style="color: #999999; font-style: italic;">//for variation taxonomy terms</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(!taxonomyTerm.IsSourceTerm)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">friendlyUrlterm.FriendlyUrlSegment.UsesDefaultValue</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">false</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">taxonomyTerm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">taxonomyTerm.SourceTerm;</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">bool</span> <span style="color: #d0d0d0;">labelUpdated</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">false</span><span style="color: #d0d0d0;">;</span>
<span style="color: #999999; font-style: italic;">//Iterate through all labels for term translation </span>
<span style="color: #6ab825; font-weight: bold;">foreach</span> <span style="color: #d0d0d0;">(Microsoft.SharePoint.Taxonomy.Label</span> <span style="color: #d0d0d0;">label</span> <span style="color: #6ab825; font-weight: bold;">in</span> <span style="color: #d0d0d0;">taxonomyTerm.Labels)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//Update the label that suites the cuurent web, i.e if current web is en-US then this will update the English Value</span>
<span style="color: #999999; font-style: italic;">//if this web is ar-SA this will update the Arabic label value</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(label.Language</span> <span style="color: #d0d0d0;">==</span> <span style="color: #d0d0d0;">contextWeb.Language)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">label.Value</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">page.Title;</span>
<span style="color: #d0d0d0;">labelUpdated</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #999999; font-style: italic;">//Always build the FriendlyUrlSegment from the English label</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(label.Language</span> <span style="color: #d0d0d0;">==</span> <span style="color: #3677a9;">1033</span><span style="color: #d0d0d0;">)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">formattedFriendlyUrlSegment</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">label.Value.RemoveAccent();</span>
<span style="color: #d0d0d0;">friendlyUrlterm.FriendlyUrlSegment.Value</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">formattedFriendlyUrlSegment.Slugify();</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #999999; font-style: italic;">//Create the language label if it doesn't exist</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(!labelUpdated)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">taxonomyTerm.CreateLabel(page.Title,</span> <span style="color: #d0d0d0;">(</span><span style="color: #6ab825; font-weight: bold;">int</span><span style="color: #d0d0d0;">)contextWeb.Language,</span> <span style="color: #6ab825; font-weight: bold;">false</span><span style="color: #d0d0d0;">);</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">taxonomyTerm.TermStore.CommitAll();</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">else</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//New Page </span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(page.PublishingWeb.Label.IsSource)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// get the current Navigation Term Set</span>
<span style="color: #d0d0d0;">NavigationTermSet</span> <span style="color: #d0d0d0;">currNavTermSet</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">TaxonomyNavigation.GetTermSetForWeb(contextWeb,</span> <span style="color: #d0d0d0;">StandardNavigationProviderNames.GlobalNavigationTaxonomyProvider,</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">// Make the Term Set Editable</span>
<span style="color: #d0d0d0;">NavigationTermSet</span> <span style="color: #d0d0d0;">editableTermSet</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">currNavTermSet.GetAsEditable(taxonomySession);</span>
<span style="color: #999999; font-style: italic;">// Get the Parent Term using the Parent Name Parameter matching the term Label</span>
<span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #d0d0d0;">defaultPageFriendlyUrlterm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">ParentNavigationTerm;</span>
<span style="color: #999999; font-style: italic;">// if a matching parent Term exists get a refernce to it</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(defaultPageFriendlyUrlterm</span> <span style="color: #d0d0d0;">!=</span> <span style="color: #6ab825; font-weight: bold;">null</span> <span style="color: #d0d0d0;">&&</span> <span style="color: #d0d0d0;">!String.IsNullOrEmpty(page.Title))</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">// make the parent Term editable</span>
<span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #d0d0d0;">editNewTerm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">defaultPageFriendlyUrlterm.GetAsEditable(taxonomySession);</span>
<span style="color: #999999; font-style: italic;">// create the new FriendlyUrl along with the new Navigation Term</span>
<span style="color: #d0d0d0;">relativeUrl</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">page.AddFriendlyUrl(page.Title,</span> <span style="color: #d0d0d0;">editNewTerm,</span> <span style="color: #d0d0d0;">AddToNavigation);</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(page.ListItem[</span><span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Guid(Constant.PublishingIsFurlPageId)]</span> <span style="color: #d0d0d0;">!=</span> <span style="color: #6ab825; font-weight: bold;">null</span> <span style="color: #d0d0d0;">&&</span> <span style="color: #d0d0d0;">!Boolean.Parse(page.ListItem[</span><span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Guid(Constant.PublishingIsFurlPageId)].ToString()))</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">page.ListItem[</span><span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Guid(Constant.PublishingIsFurlPageId)]</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">page.ListItem.SystemUpdate();</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">catch</span> <span style="color: #d0d0d0;">(Exception</span> <span style="color: #d0d0d0;">ex)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">Logger.LogException(ex);</span>
<span style="color: #d0d0d0;">Logger.LogException(</span><span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Exception(</span><span style="color: #ed9d13;">"StackTrace : "</span> <span style="color: #d0d0d0;">+</span> <span style="color: #d0d0d0;">ex.StackTrace));</span>
<span style="color: #6ab825; font-weight: bold;">throw</span> <span style="color: #d0d0d0;">ex;</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">});</span>
<span style="color: #6ab825; font-weight: bold;">return</span> <span style="color: #d0d0d0;">relativeUrl;</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">public</span> <span style="color: #6ab825; font-weight: bold;">static</span> <span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #447fcf;">GetWebDefaultPageTerm</span><span style="color: #d0d0d0;">(SPWeb</span> <span style="color: #d0d0d0;">web)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//list for saving the urls</span>
<span style="color: #d0d0d0;">NavigationTerm</span> <span style="color: #d0d0d0;">friendlyUrlterm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">null</span><span style="color: #d0d0d0;">;</span>
<span style="color: #999999; font-style: italic;">//check if the current web is a publishing weg</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(PublishingWeb.IsPublishingWeb(web))</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">PublishingWeb</span> <span style="color: #d0d0d0;">publishingWeb</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">PublishingWeb.GetPublishingWeb(web);</span>
<span style="color: #d0d0d0;">SPListItem</span> <span style="color: #d0d0d0;">DefaultPage</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">publishingWeb.DefaultPage.Item;</span>
<span style="color: #999999; font-style: italic;">//get the pages list id</span>
<span style="color: #d0d0d0;">Guid</span> <span style="color: #d0d0d0;">listId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">PublishingWeb.GetPagesListId(web);</span>
<span style="color: #999999; font-style: italic;">//retrieve the pages list</span>
<span style="color: #d0d0d0;">SPList</span> <span style="color: #d0d0d0;">pagesList</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">web.Lists[listId];</span>
<span style="color: #999999; font-style: italic;">//retrieve the terms used for the navigation (this can be multiple terms)</span>
<span style="color: #d0d0d0;">IList<NavigationTerm></span> <span style="color: #d0d0d0;">terms</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">TaxonomyNavigation.GetFriendlyUrlsForListItem(DefaultPage,</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">);</span>
<span style="color: #6ab825; font-weight: bold;">string</span> <span style="color: #d0d0d0;">url</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">string</span><span style="color: #d0d0d0;">.Empty;</span>
<span style="color: #999999; font-style: italic;">//check if the pages has terms associated with it</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(terms.Count</span> <span style="color: #d0d0d0;">></span> <span style="color: #3677a9;">0</span><span style="color: #d0d0d0;">)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//use the GetResolvedDisplayUrl to retrieve the page friendly urls</span>
<span style="color: #d0d0d0;">friendlyUrlterm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">terms[</span><span style="color: #3677a9;">0</span><span style="color: #d0d0d0;">];</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #6ab825; font-weight: bold;">return</span> <span style="color: #d0d0d0;">friendlyUrlterm;</span>
<span style="color: #d0d0d0;">}</span>
</span></pre>
</div>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">
</span><br />
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;"><br /></span>
<span style="color: #333333; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 15px; line-height: 22.2000007629395px;">Hope you found this article useful :) </span></div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com6tag:blogger.com,1999:blog-7265446347879207534.post-76541047920889662282015-02-18T15:56:00.000+02:002015-02-18T15:56:12.538+02:00Deploying Managed Metadata Fields declaratively in SharePoint - Tips and Tricks<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #363636; font-family: Arial, Helvetica; font-size: 12.8000001907349px;">In this article, we will see how we can deploy <a href="http://magenic.com/BlogArchive/CorrectlyProvisioningManagedMetadataTaxonomyF" target="_blank">Managed metadata fields</a> in a declarative way in SharePoint </span><br />
<span style="background-color: white; color: #363636; font-family: Arial, Helvetica; font-size: 12.8000001907349px;"><br /></span>
<span style="background-color: white; font-size: 12.8000001907349px;"><span style="color: #363636; font-family: Arial, Helvetica;">A m<a href="https://technet.microsoft.com/en-us/library/ee424402.aspx" target="_blank">anaged metadata column</a> lets you control the information that people can enter into a column. Users select the terms or phrases that they enter in the column from a pre-defined set of managed terms.</span></span><br />
<span style="background-color: white; font-size: 12.8000001907349px;"><span style="color: #363636; font-family: Arial, Helvetica;"><br /></span></span>
<span style="background-color: white; font-size: 12.8000001907349px;"><span style="color: #363636; font-family: Arial, Helvetica;">The challenge comes when you want to provision your custom managed metadata navigation field</span></span><span style="background-color: white; color: #363636; font-family: Arial, Helvetica; font-size: 12.8000001907349px;"> </span><span style="background-color: white;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">in a declarative way, and adding this column to a content type or a list instance without losing all the powerful features that comes along using this field type.</span></span></span><br />
<span style="background-color: white;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><br /></span></span></span>
<span style="background-color: white;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Out of the Box, if you added a managed column to your list SharePoint performs some actions behind the scene:</span></span></span><br />
<ol style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Creates a hidden note field attached to your column</span></span></li>
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Attached your list to two event receivers to update the<a href="https://sharepointtrac.wordpress.com/2013/10/29/taxonomy-hidden-list/" target="_blank"> taxonomy hidden list </a>.</span></span></li>
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Fills in some properties related to the current web and taxonomy list id</span></span></li>
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Creates a taxonomy search managed property after a full crawl that could be used as a refiner or even as a category column if you are planning to use the Product Catalog model.</span></span></li>
</ol>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">So there are a lot of articles explaining how to deploy Managed Metadata Fields declarative in SharePoint, but they are scattered :) , so I decided to aggregate all the tips and tricks to cover this task.</span></span></div>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><br /></span></span></div>
<div>
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Taxonomy Field declarative XML, no tricks here :)</span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #6ab825; font-weight: bold;"><Field</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}"</span>
<span style="color: #bbbbbb;">Type=</span><span style="color: #ed9d13;">"TaxonomyFieldType"</span>
<span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"$Resources:myResourceFile,EventType"</span>
<span style="color: #bbbbbb;">ShowField=</span><span style="color: #ed9d13;">"Term1033"</span>
<span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"TRUE"</span>
<span style="color: #bbbbbb;">EnforceUniqueValues=</span><span style="color: #ed9d13;">"FALSE"</span>
<span style="color: #bbbbbb;">Group=</span><span style="color: #ed9d13;">"Custom"</span>
<span style="color: #bbbbbb;">StaticName=</span><span style="color: #ed9d13;">"CustomEventType"</span>
<span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"</span></span></span><span style="color: #ed9d13; font-family: Arial, Helvetica; font-size: 12.8000001907349px; line-height: 125%;">CustomEventType</span><span style="color: #ed9d13; font-family: Arial, Helvetica; font-size: 12.8000001907349px; line-height: 125%;">"</span>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"> <span style="color: #bbbbbb;">Filterable=</span><span style="color: #ed9d13;">"TRUE"</span>
<span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><br /></span></span></div>
<div>
<br />
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">SharePoint creates a hidden note field to be field with selected values while filling the taxonomy field, here comes the tricky part, while adding your custom field to the list you MUST add this hidden field along with it, The Display name should follow the following convention 'TaxonomyField_0' and the static name should follow the following convention 'TaxononmyFieldTaxHTField0', without following this conventions SharePoint search<b><u style="background-color: yellow;"> will not generate the crawled property</u></b> for your custom column '</span><span style="background-color: rgba(255, 255, 255, 0.85098); color: #444444; font-family: 'Segoe UI', Segoe, Tahoma, Helvetica, Arial, sans-serif; font-size: 13px;">ows_taxId_CustomEventType</span><span style="font-size: 12.8000001907349px;">', and for sure will not create the managed property 'owstaxidKataraEventType' </span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #6ab825; font-weight: bold;"><Field</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}"</span>
<span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"CustomEventTypeTaxHTField0"</span>
<span style="color: #bbbbbb;">StaticName=</span><span style="color: #ed9d13;">"KataraEventTypeTaxHTField0"</span>
<span style="color: #bbbbbb;">SourceID=</span><span style="color: #ed9d13;">"http://schemas.microsoft.com/sharepoint/v3/fields"</span>
<span style="color: #bbbbbb;">Type=</span><span style="color: #ed9d13;">"Note"</span>
<span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"CustomEventType_0"</span>
<span style="color: #bbbbbb;">Group=</span><span style="color: #ed9d13;">"Katara"</span>
<span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">After declaring the schema of both field you should get them connected together, and should attach the created column to a specific Term Set and specific Term to choose from as a source, this could be achived by adding a feature event receiver using the following code snippet.</span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #d0d0d0;">SPSite</span> <span style="color: #d0d0d0;">site</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">properties.Feature.Parent</span> <span style="color: #6ab825; font-weight: bold;">as</span> <span style="color: #d0d0d0;">SPSite;</span>
<span style="color: #d0d0d0;">Guid</span> <span style="color: #d0d0d0;">eventFieldId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Guid(</span><span style="color: #ed9d13;">"{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}"</span><span style="color: #d0d0d0;">);</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(site.RootWeb.Fields.Contains(eventFieldId))</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">TaxonomySession</span> <span style="color: #d0d0d0;">session</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">TaxonomySession(site);</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(session.TermStores.Count</span> <span style="color: #d0d0d0;">!=</span> <span style="color: #3677a9;">0</span><span style="color: #d0d0d0;">)</span>
<span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">termStore</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">session.TermStores[</span><span style="color: #ed9d13;">"Managed Metadata Serivce"</span><span style="color: #d0d0d0;">];</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #6ab825; font-weight: bold;">group</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">termStore.Groups[</span><span style="color: #ed9d13;">"YOUR GROUP NAME"</span><span style="color: #d0d0d0;">];</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">termSet</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">group</span><span style="color: #d0d0d0;">.TermSets[</span><span style="color: #ed9d13;">"YOUR TERM SET NAME"</span><span style="color: #d0d0d0;">];</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">eventTypeTerm</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">termSet.Terms[</span><span style="color: #ed9d13;">"THE TERM NAME CONTAINING YOUR VALUE"</span><span style="color: #d0d0d0;">];</span>
<span style="color: #d0d0d0;">TaxonomyField</span> <span style="color: #d0d0d0;">eventField</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">site.RootWeb.Fields[eventFieldId]</span> <span style="color: #6ab825; font-weight: bold;">as</span> <span style="color: #d0d0d0;">TaxonomyField;</span>
<span style="color: #999999; font-style: italic;">//Attach the note field to the taxonomy field</span>
<span style="color: #d0d0d0;">eventField.TextField</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">Guid(</span><span style="color: #ed9d13;">"{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}"</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">// Connect to MMS</span>
<span style="color: #d0d0d0;">eventField.SspId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">termSet.TermStore.Id;</span>
<span style="color: #d0d0d0;">eventField.TermSetId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">termSet.Id;</span>
<span style="color: #d0d0d0;">eventField.TargetTemplate</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">string</span><span style="color: #d0d0d0;">.Empty;</span>
<span style="color: #d0d0d0;">eventField.AnchorId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">eventTypeTerm.Id;</span>
<span style="color: #d0d0d0;">eventField.LookupWebId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">site.RootWeb.ID;</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(eventField.TypeAsString</span> <span style="color: #d0d0d0;">==</span> <span style="color: #ed9d13;">"TaxonomyFieldTypeMulti"</span><span style="color: #d0d0d0;">)</span>
<span style="color: #d0d0d0;">ageGroupField.AllowMultipleValues</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">true</span><span style="color: #d0d0d0;">;</span>
<span style="color: #d0d0d0;">eventField.Update();</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">In this stage we have our field provisioned and added to our site as a site column, the next step is to add it to a content type, the trick here is we must add two hidden fields <b><u>'</u></b></span><span style="font-size: 12.8000001907349px;"><b><u>TaxCatchAll' & 'TaxCatchAllLabel'</u></b> fields,If it doesn’t, then you won’t get facets showing up correctly in faceted search. Note that not having the TaxCatchAll and TaxCatchAllLabel pair of columns in your list or library or content type can cause that - See more at: http://magenic.com/BlogArchive/CorrectlyProvisioningManagedMetadataTaxonomyF#sthash.hlkj6Xqo.dpuf</span></span></li>
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"> so our field references will be like the following </span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #6ab825; font-weight: bold;"><FieldRef</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{20A3C69E-FFFB-43F4-BBDF-2D22BAF0EB84}"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"$Resources:FILENAME_Columns,EventType;"</span> <span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"CustomEventType"</span> <span style="color: #bbbbbb;">Filterable=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
<span style="color: #6ab825; font-weight: bold;"><FieldRef</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{09F37A61-50FE-413E-941F-3BEE2A1B5BF8}"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"CustomEventType_0"</span> <span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"CustomEventTypeTaxHTField0"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
<span style="color: #6ab825; font-weight: bold;"><FieldRef</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{f3b0adf9-c1a2-4b02-920d-943fba4b3611}"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"Taxonomy Catch All Column"</span> <span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"TaxCatchAll"</span> <span style="color: #bbbbbb;">Sealed=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
<span style="color: #6ab825; font-weight: bold;"><FieldRef</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{8f6b6dd8-9357-4019-8172-966fcd502ed2}"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"Taxonomy Catch All Column1"</span> <span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"TaxCatchAllLabel"</span> <span style="color: #bbbbbb;">ReadOnly=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sealed=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"> Now we come to the next trick, referencing those columns to a list template in the schema.xml file , the trick here is to declare the TaxHiddenList </span><span style="font-size: 12.8000001907349px;"> <b><u>'</u></b></span><span style="font-size: 12.8000001907349px;"><b><u>TaxCatchAll' & 'TaxCatchAllLabel'</u></b> </span><span style="font-size: 12.8000001907349px;">correctly to the the list schema, those fields are a lookup columns so they need the information list (source), following is the definetion, NOTE the List attribute. </span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #6ab825; font-weight: bold;"><Field</span> <span style="color: #bbbbbb;">Type=</span><span style="color: #ed9d13;">"LookupMulti"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"Taxonomy Catch All Column"</span> <span style="color: #bbbbbb;">StaticName=</span><span style="color: #ed9d13;">"TaxCatchAll"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"TaxCatchAll"</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{f3b0adf9-c1a2-4b02-920d-943fba4b3611}"</span> <span style="color: #bbbbbb;">ShowInViewForms=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">List=</span><span style="color: #ed9d13;">"Lists/TaxonomyHiddenList"</span> <span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">CanToggleHidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">ShowField=</span><span style="color: #ed9d13;">"CatchAllData"</span> <span style="color: #bbbbbb;">SourceID=</span><span style="color: #ed9d13;">"{1e46f7fe-3764-40b5-abd1-1746c716214b}"</span> <span style="color: #bbbbbb;">Mult=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">AllowDeletion=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sealed=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Version=</span><span style="color: #ed9d13;">"2"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
<span style="color: #6ab825; font-weight: bold;"><Field</span> <span style="color: #bbbbbb;">Type=</span><span style="color: #ed9d13;">"LookupMulti"</span> <span style="color: #bbbbbb;">DisplayName=</span><span style="color: #ed9d13;">"Taxonomy Catch All Column1"</span> <span style="color: #bbbbbb;">StaticName=</span><span style="color: #ed9d13;">"TaxCatchAllLabel"</span> <span style="color: #bbbbbb;">Name=</span><span style="color: #ed9d13;">"TaxCatchAllLabel"</span> <span style="color: #bbbbbb;">ID=</span><span style="color: #ed9d13;">"{8f6b6dd8-9357-4019-8172-966fcd502ed2}"</span> <span style="color: #bbbbbb;">ShowInViewForms=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">List=</span><span style="color: #ed9d13;">"Lists/TaxonomyHiddenList"</span> <span style="color: #bbbbbb;">Required=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">Hidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">CanToggleHidden=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">ShowField=</span><span style="color: #ed9d13;">"CatchAllDataLabel"</span> <span style="color: #bbbbbb;">FieldRef=</span><span style="color: #ed9d13;">"{F3B0ADF9-C1A2-4b02-920D-943FBA4B3611}"</span> <span style="color: #bbbbbb;">SourceID=</span><span style="color: #ed9d13;">"{1e46f7fe-3764-40b5-abd1-1746c716214b}"</span> <span style="color: #bbbbbb;">ReadOnly=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Mult=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sortable=</span><span style="color: #ed9d13;">"FALSE"</span> <span style="color: #bbbbbb;">AllowDeletion=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Sealed=</span><span style="color: #ed9d13;">"TRUE"</span> <span style="color: #bbbbbb;">Version=</span><span style="color: #ed9d13;">"2"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><br /></span></span></div>
<ul style="text-align: left;">
<li><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Finally, we need to attache the "</span><span style="font-size: 12.8000001907349px;">TaxonomyItemSynchronousAddedEventReceiver" & "TaxonomyItemUpdatingEventReceiver" to update all the hidden fields.</span></span></li>
</ul>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #f0f3f3; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><span style="color: #330099; font-weight: bold;"><Receiver></span>
<span style="color: #330099; font-weight: bold;"><Name></span>TaxonomyItemSynchronousAddedEventReceiver<span style="color: #330099; font-weight: bold;"></Name></span>
<span style="color: #330099; font-weight: bold;"><Type></span>ItemAdding<span style="color: #330099; font-weight: bold;"></Type></span>
<span style="color: #330099; font-weight: bold;"><Assembly></span>Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c<span style="color: #330099; font-weight: bold;"></Assembly></span>
<span style="color: #330099; font-weight: bold;"><Class></span>Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver<span style="color: #330099; font-weight: bold;"></Class></span>
<span style="color: #330099; font-weight: bold;"><SequenceNumber></span>10000<span style="color: #330099; font-weight: bold;"></SequenceNumber></span>
<span style="color: #330099; font-weight: bold;"></Receiver></span>
<span style="color: #330099; font-weight: bold;"><Receiver></span>
<span style="color: #330099; font-weight: bold;"><Name></span>TaxonomyItemUpdatingEventReceiver<span style="color: #330099; font-weight: bold;"></Name></span>
<span style="color: #330099; font-weight: bold;"><Type></span>ItemUpdating<span style="color: #330099; font-weight: bold;"></Type></span>
<span style="color: #330099; font-weight: bold;"><Assembly></span>Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c<span style="color: #330099; font-weight: bold;"></Assembly></span>
<span style="color: #330099; font-weight: bold;"><Class></span>Microsoft.SharePoint.Taxonomy.TaxonomyItemEventReceiver<span style="color: #330099; font-weight: bold;"></Class></span>
<span style="color: #330099; font-weight: bold;"><SequenceNumber></span>10000<span style="color: #330099; font-weight: bold;"></SequenceNumber></span>
<span style="color: #330099; font-weight: bold;"></Receiver></span>
</span></span></pre>
</div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">
</span></span></div>
<div>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;"><br /></span></span>
<span style="color: #363636; font-family: Arial, Helvetica;"><span style="font-size: 12.8000001907349px;">Now you are all set to enjoy many many features and ideas that this colum type offers :)</span></span></div>
</div>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com3tag:blogger.com,1999:blog-7265446347879207534.post-14046274666531231652014-09-25T16:25:00.000+03:002014-09-25T16:25:57.440+03:00Using Knockout and CSOM (Client Side Object Model) for pages libraries and binding the output in a jcarousel Slider - The full Example<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="background-color: white; font-size: 13px; line-height: 20px; margin-bottom: 10px; margin-top: 10px; padding: 0px; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">KnockoutJS is a fantastic library when you are looking for a drop-in enhancement that brings in client side data-binding and applies the Model-View-View-Model design pattern to your websites.</span></div>
<div style="background-color: white; font-size: 13px; line-height: 20px; margin-bottom: 10px; margin-top: 10px; padding: 0px; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;">Knockout works with a ViewModel that can either be a JS object or a JS function. Either ways, your ViewModel is your data source. Using Knockout, you can bind DOM elements to your model using a declarative syntax. Knockout also provides Templating (for repetitive structures in a web page) and dependency tracking using ko.observableArray. With dependency tracking, if a property is changed, it will automatically notify the UI. The UI reflects these changes and can also change the value to automatically update the source object again.</span></div>
<div style="background-color: white; margin-bottom: 10px; margin-top: 10px; padding: 0px; text-align: justify;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">Using REST APIs and CSOM in your SharePoint implementations nowadays is a must for the rise of using SharePoint apps and SharePoint online, the glory of Server Side Object Model is fading and the technology now is going towards the client side operations.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span>
<span style="line-height: 20px;">In this article we will discuss a simple feature - Getting SharePoint List Item form Page Library using CSOM - Then we will bind the returned results to a predefined HTML DOM elements to have those results in jcarousel slider.</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span>
</span><br />
<ol>
<li><span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px;">Get Page List Items using CSOM</span></li>
</ol>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">If you want to get pages (List Items) from SharePoint using Client Side scripts you have two approaches, CSOM or using REST APIs, In our case we will use CSOM as when I tried calling REST API for my pages library including the Roll up Image </span></span><span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px;">Field</span><span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px;"> </span><span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">"http://server/en/News/_api/web/Lists/getbytitle('Pages')/items?$select=Id,Title,FileRef,PublishingRollupImage"</span></span><span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px;"> , I had the following error:</span></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRKA6nXAzQdSUGkXr2KQDBL9cXKBUollZ8pcHLS87dHbc6XVAEZoDL25sUkgXlDVcdmX9ylh93XA3NWM4jOhx7DGLWwXdg3mX3E0tXj0HLhtw-kTfgub1FrscLhAaujynIEuGP_ELjw2E/s1600/5.png" imageanchor="1" style="font-family: Arial, Helvetica, sans-serif; font-size: small; line-height: 20px; margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRKA6nXAzQdSUGkXr2KQDBL9cXKBUollZ8pcHLS87dHbc6XVAEZoDL25sUkgXlDVcdmX9ylh93XA3NWM4jOhx7DGLWwXdg3mX3E0tXj0HLhtw-kTfgub1FrscLhAaujynIEuGP_ELjw2E/s1600/5.png" height="195" width="640" /></a></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">Anyway to select the Pages Items we will use the below method "</span></span><span style="background-color: #202020; color: #d0d0d0; line-height: 16.25px;">SelectNewsPages"</span><span style="font-family: Arial, Helvetica, sans-serif; line-height: 20px;"> I've commented the code inline with the explanation for each line :</span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>Add the following Script links:</b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b><br /></b></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/sp.runtime.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b><br /></b></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>Select News Pages JS:</b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"></span></span><!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">SelectNewsPages()</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//Get pages library sub web </span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">WebUrl</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">_spPageContextInfo.webAbsoluteUrl</span> <span style="color: #d0d0d0;">+</span> <span style="color: #ed9d13;">"/News"</span><span style="color: #d0d0d0;">;</span>
<span style="color: #999999; font-style: italic;">//Load Context according to news sub site</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">context</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">SP.ClientContext(WebUrl);</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">NewsWeb</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">context.get_web();</span>
<span style="color: #999999; font-style: italic;">//Get Pages Library (List)</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">PagesList</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">NewsWeb.get_lists().getByTitle(</span><span style="color: #ed9d13;">'Pages'</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">//Build the selection query</span>
<span style="color: #999999; font-style: italic;">//in this example we select a specific content type, Ordered By Article date desc and row limited to 5 Items</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">NewsContentTypeId</span> <span style="color: #d0d0d0;">=</span> <span style="color: #ed9d13;">'0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00C2CE4371BE4442CB9AE069A5FDF4163A'</span><span style="color: #d0d0d0;">;</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">query</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">SP.CamlQuery();</span>
<span style="color: #d0d0d0;">query.set_viewXml(</span><span style="color: #ed9d13;">"<View><Query><Where><BeginsWith><FieldRef Name='ContentTypeId' /><Value Type='ContentTypeId'>"</span> <span style="color: #d0d0d0;">+</span> <span style="color: #d0d0d0;">NewsContentTypeId</span> <span style="color: #d0d0d0;">+</span> <span style="color: #ed9d13;">"</Value></BeginsWith></Where><OrderBy><FieldRef Name='ArticleStartDate' Ascending='FALSE' /></OrderBy></Query><RowLimit>5</RowLimit></View>"</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">//Get List Items</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">collListItem</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">PagesList.getItems(query);</span>
<span style="color: #999999; font-style: italic;">//Include the view fields</span>
<span style="color: #d0d0d0;">context.load(collListItem,</span> <span style="color: #ed9d13;">'Include(FileRef,Title,RoutingRuleDescription,ArticleStartDate,PublishingRollupImage,ContentType)'</span><span style="color: #d0d0d0;">);</span>
<span style="color: #999999; font-style: italic;">//Execute your Query Async, and define the success and failure handlers</span>
<span style="color: #d0d0d0;">context.executeQueryAsync(</span>
<span style="color: #24909d;">Function</span><span style="color: #d0d0d0;">.createDelegate(</span><span style="color: #6ab825; font-weight: bold;">this</span><span style="color: #d0d0d0;">,</span> <span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">()</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #999999; font-style: italic;">//DO Some Logic for Success</span>
<span style="color: #d0d0d0;">}),</span>
<span style="color: #24909d;">Function</span><span style="color: #d0d0d0;">.createDelegate(</span><span style="color: #6ab825; font-weight: bold;">this</span><span style="color: #d0d0d0;">,</span> <span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">()</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">alert(args.get_message());</span>
<span style="color: #d0d0d0;">}));</span>
<span style="color: #d0d0d0;">}</span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span><span style="line-height: 20px;">Now lets under stand the Knockout view model, Simply in our model we will define:</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"> - The Object that we will bind ( If you are using REST APIs the data already is in JSON format so no need to define your own structure )</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"> - The observable array that will contain all objects to be bind</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"> - The get method that will fill the array</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">First download the following files and add the following references: </span></span><br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/knockout-3.2.0.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/ko.sp-1.0.min.Ex.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
</pre>
</td></tr>
</tbody></table>
</div>
<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">REST API Example:</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">EmployeeModal()</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">var</span> <span style="color: #d0d0d0;">self</span> <span style="color: #d0d0d0;">=</span> <span style="color: #6ab825; font-weight: bold;">this</span><span style="color: #d0d0d0;">;</span>
<span style="color: #999999; font-style: italic;">//Data array holding objects to be bind</span>
<span style="color: #d0d0d0;">self.Employees</span> <span style="color: #d0d0d0;">=</span> <span style="color: #d0d0d0;">ko.observableArray([]);</span>
<span style="color: #999999; font-style: italic;">//Get method</span>
<span style="color: #d0d0d0;">$.getJSON(_spPageContextInfo.webAbsoluteUrl</span> <span style="color: #d0d0d0;">+</span> <span style="color: #ed9d13;">"/_vti_bin/listdata.svc/Employees?$expand=Skills,ModifiedBy"</span><span style="color: #d0d0d0;">,</span>
<span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">(data)</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #6ab825; font-weight: bold;">if</span> <span style="color: #d0d0d0;">(data.d.results)</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">self.Employees(ko.toJS(data.d.results));</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">);</span>
<span style="color: #d0d0d0;">}</span>
<span style="color: #d0d0d0;">$(</span><span style="color: #24909d;">document</span><span style="color: #d0d0d0;">).ready(</span><span style="color: #6ab825; font-weight: bold;">function</span> <span style="color: #d0d0d0;">()</span> <span style="color: #d0d0d0;">{</span>
<span style="color: #d0d0d0;">ko.applyBindings(</span><span style="color: #6ab825; font-weight: bold;">new</span> <span style="color: #d0d0d0;">EmployeeModal());</span>
<span style="color: #d0d0d0;">});</span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">For our example using CSOM :</span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>Add following in the header</b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b><br /></b></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7
8</pre>
</td><td><pre style="line-height: 125%; margin: 0;"><span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><link</span> <span style="color: #bbbbbb;">rel=</span><span style="color: #ed9d13;">"stylesheet"</span> <span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/css"</span> <span style="color: #bbbbbb;">href=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/jcarousel.basic.css"</span> <span style="color: #6ab825; font-weight: bold;">/></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/jcarousel.basic.js"</span> <span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/jquery.jcarousel.min.js"</span> <span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"//ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/sp.runtime.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/knockout-3.2.0.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
<span style="color: #6ab825; font-weight: bold;"><script </span><span style="color: #bbbbbb;">type=</span><span style="color: #ed9d13;">"text/javascript"</span> <span style="color: #bbbbbb;">src=</span><span style="color: #ed9d13;">"/_layouts/15/myScripts/ko.sp-1.0.min.Ex.js"</span><span style="color: #6ab825; font-weight: bold;">></script></span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>Following the HTML DOM to be bind</b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>- Item Template Definition in the header</b></span></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span>
<br />
<div style="background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="border: 1px solid #ef2929; color: #a40000;"><</span>%--Set the ID of the item template to be linked in the main foreach binder--%>
<span style="color: #204a87; font-weight: bold;"><script </span><span style="color: #c4a000;">type=</span><span style="color: #4e9a06;">"text/html"</span> <span style="color: #c4a000;">id=</span><span style="color: #4e9a06;">"NewsItem"</span><span style="color: #204a87; font-weight: bold;">></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: black;">li</span><span style="color: #ce5c00; font-weight: bold;">></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: black;">a</span> <span style="color: black;">data</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: black;">bind</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">"attr: { href: Url, title: Title }"</span><span style="color: #ce5c00; font-weight: bold;">></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: black;">img</span> <span style="color: black;">data</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: black;">bind</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">"attr: { src: Image, alt: Title }"</span> <span style="color: black;">width</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">'900'</span> <span style="color: black;">height</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">'395'</span> <span style="color: #ce5c00; font-weight: bold;">/></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="border: 1px solid #ef2929; color: #a40000;">/a></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: black;">h3</span> <span style="color: black;">data</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: black;">bind</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">"text: Title"</span><span style="color: #ce5c00; font-weight: bold;">><</span><span style="border: 1px solid #ef2929; color: #a40000;">/h3></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="color: black;">p</span> <span style="color: black;">data</span><span style="color: #ce5c00; font-weight: bold;">-</span><span style="color: black;">bind</span><span style="color: #ce5c00; font-weight: bold;">=</span><span style="color: #4e9a06;">"text: Summary"</span><span style="color: #ce5c00; font-weight: bold;">><</span><span style="border: 1px solid #ef2929; color: #a40000;">/p></span>
<span style="color: #ce5c00; font-weight: bold;"><</span><span style="border: 1px solid #ef2929; color: #a40000;">/li></span>
<span style="color: #204a87; font-weight: bold;"></script></span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><b>- Main Carousel container </b></span></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #f8f8f8; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7
8</pre>
</td><td><pre style="line-height: 125%; margin: 0;"> <span style="color: #204a87; font-weight: bold;"><div</span> <span style="color: #c4a000;">class=</span><span style="color: #4e9a06;">"jcarousel-wrapper"</span><span style="color: #204a87; font-weight: bold;">></span>
<span style="color: #204a87; font-weight: bold;"><div</span> <span style="color: #c4a000;">class=</span><span style="color: #4e9a06;">"jcarousel"</span><span style="color: #204a87; font-weight: bold;">></span>
<span style="border: 1px solid #ef2929; color: #a40000;"><</span>%--The binder will itterate using foreach in the KO observable array 'sliderAllAnnouncments' , Binding the objects using the predefined item template--%>
<span style="color: #204a87; font-weight: bold;"><ul</span> <span style="color: #c4a000;">class=</span><span style="color: #4e9a06;">"jcarousel-ul"</span> <span style="color: #c4a000;">data-bind=</span><span style="color: #4e9a06;">"template: { name: 'NewsItem', foreach: sliderAllAnnouncments }"</span> <span style="color: #204a87; font-weight: bold;">/></span>
<span style="color: #204a87; font-weight: bold;"></div></span>
<span style="color: #204a87; font-weight: bold;"><a</span> <span style="color: #c4a000;">href=</span><span style="color: #4e9a06;">"#"</span> <span style="color: #c4a000;">class=</span><span style="color: #4e9a06;">"jcarousel-control-prev bg-arrow-left"</span><span style="color: #204a87; font-weight: bold;">></span>‹<span style="color: #204a87; font-weight: bold;"></a></span>
<span style="color: #204a87; font-weight: bold;"><a</span> <span style="color: #c4a000;">href=</span><span style="color: #4e9a06;">"#"</span> <span style="color: #c4a000;">class=</span><span style="color: #4e9a06;">"jcarousel-control-next bg-arrow-right"</span><span style="color: #204a87; font-weight: bold;">></span>›<span style="color: #204a87; font-weight: bold;"></a></span>
<span style="color: #204a87; font-weight: bold;"></div></span>
</pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><span style="line-height: 20px;">The Knockout View Model using CSOM - </span><i style="line-height: 20px;">FULL CODE INCLUDING PREVIOUS </i><span style="line-height: 20px;"><i>SNIPPET</i> :</span></b></span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><b><span style="line-height: 20px;"><br /></span></b></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><!-- HTML generated using hilite.me --></span></span><br />
<div style="background: #202020; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;"> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92</pre>
</td><td><pre style="margin: 0px;"><span style="color: #999999;"><span style="line-height: 125%;"><i>//Load a loading image till the items are </i></span><span style="line-height: 16.25px;"><i>acquired</i></span><span style="line-height: 125%;"><i> </i></span></span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #24909d; line-height: 125%;">window</span><span style="color: #d0d0d0; line-height: 125%;">).load(</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">if</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">($(</span><span style="color: #ed9d13; line-height: 125%;">".jcarousel-ul"</span><span style="color: #d0d0d0; line-height: 125%;">).html()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">!=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">null</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">".jcarousel-ul"</span><span style="color: #d0d0d0; line-height: 125%;">).html(</span><span style="color: #ed9d13; line-height: 125%;">"<CENTER><div class='loader' style='position:absolute;left:50%; top:50%;'><CENTER><img src='/_layouts/15/EQNewsScripts//ajax-loader.gif' /></CENTER></div></CENTER>"</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">".loader"</span><span style="color: #d0d0d0; line-height: 125%;">).show();</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Delay the calling till the sp.js is loaded</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">SP.SOD.executeFunc(</span><span style="color: #ed9d13; line-height: 125%;">'sp.js'</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">'SP.ClientContext'</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">LoadNews)</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">})</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Intialize the view model and apply bindings</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">LoadNews()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">VM</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">new</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">viewModel();</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">VM.sliderRetrieveAnnouncments();</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">ko.applyBindings(VM);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">viewModel()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">self</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">;</span><span style="line-height: 125%;">
</span><span style="color: #999999;"><span style="line-height: 125%;"><i>// </i></span><span style="line-height: 16.25px;"><i>Definition</i></span><span style="line-height: 125%;"><i> for the bind object</i></span></span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">self.sliderAnnouncement</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">(Url,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Title,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Image,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Summary,</span><span style="line-height: 125%;"> </span><span style="color: #24909d; line-height: 125%;">Date</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">.Url</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Url;</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">.Title</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Title;</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">.Image</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Image;</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">.Summary</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">Summary;</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">.</span><span style="color: #24909d; line-height: 125%;">Date</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #24909d; line-height: 125%;">Date</span><span style="color: #d0d0d0; line-height: 125%;">;</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #999999;"><span style="line-height: 125%;"><i>// </i></span><span style="line-height: 16.25px;"><i>Definition</i></span><span style="line-height: 125%;"><i> for Array holding objects to be binded</i></span></span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">self.sliderAllAnnouncments</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">ko.observableArray([]);</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Get Items using CSOM</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">self.sliderRetrieveAnnouncments</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">WebUrl</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">_spPageContextInfo.webAbsoluteUrl</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">+</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">"/News"</span><span style="color: #d0d0d0; line-height: 125%;">;</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">context</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">new</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">SP.ClientContext(WebUrl);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">NewsWeb</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">context.get_web();</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">PagesList</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">NewsWeb.get_lists().getByTitle(</span><span style="color: #ed9d13; line-height: 125%;">'Pages'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">query</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">new</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">SP.CamlQuery();</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">query.set_viewXml(</span><span style="color: #ed9d13; line-height: 125%;">"<View><Query><Where><BeginsWith><FieldRef Name='ContentTypeId' /><Value Type='ContentTypeId'>0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900242457EFB8B24247815D688C526CD44D00C2CE4371BE4442CB9AE069A5FDF4163A</Value></BeginsWith></Where><OrderBy><FieldRef Name='ArticleStartDate' Ascending='FALSE' /></OrderBy></Query><RowLimit>5</RowLimit></View>"</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">collListItem</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">PagesList.getItems(query);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">context.load(collListItem,</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">'Include(FileRef,Title,RoutingRuleDescription,ArticleStartDate,PublishingRollupImage,ContentType)'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">context.executeQueryAsync(</span><span style="line-height: 125%;">
</span><span style="color: #24909d; line-height: 125%;">Function</span><span style="color: #d0d0d0; line-height: 125%;">.createDelegate(</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//The data loaded successfully, So hide the loader section and begin pushing data</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">".loader"</span><span style="color: #d0d0d0; line-height: 125%;">).hide();</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">".jcarousel-ul"</span><span style="color: #d0d0d0; line-height: 125%;">).empty();</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">listItemEnumerator</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">collListItem.getEnumerator();</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">length</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">collListItem.get_count();</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">if</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">(length</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">></span><span style="line-height: 125%;"> </span><span style="color: #3677a9; line-height: 125%;">0</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Fetch the returned data and wrap to the observable array</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">while</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">(listItemEnumerator.moveNext())</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">listItemEnumerator.get_current();</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">if</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">(oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'PublishingRollupImage'</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">!=</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">null</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">URL</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'FileRef'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageTitle</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'Title'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageSummary</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'RoutingRuleDescription'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageDate</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'ArticleStartDate'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">var</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">''</span><span style="color: #d0d0d0; line-height: 125%;">;</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">pageImage</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">oListItem.get_item(</span><span style="color: #ed9d13; line-height: 125%;">'PublishingRollupImage'</span><span style="color: #d0d0d0; line-height: 125%;">);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">pageImage</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage.substr(pageImage.indexOf(</span><span style="color: #ed9d13; line-height: 125%;">'src="'</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">+</span><span style="line-height: 125%;"> </span><span style="color: #3677a9; line-height: 125%;">5</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage.length);</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">pageImage</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">=</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage.substr(</span><span style="color: #3677a9; line-height: 125%;">0</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage.indexOf(</span><span style="color: #ed9d13; line-height: 125%;">'"'</span><span style="color: #d0d0d0; line-height: 125%;">));</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Push the new data to the data observable array </span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">self.sliderAllAnnouncments.push(</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">new</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">self.sliderAnnouncement(URL,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageTitle,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageImage,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageSummary,</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">pageDate));</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #999999; font-style: italic; line-height: 125%;">//Data are binded to the HTML DOM, Rejester the <ul> tag for jcarousel</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">'.jcarousel'</span><span style="color: #d0d0d0; line-height: 125%;">)</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">.jcarousel({</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">wrap:</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">'circular'</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">})</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">.jcarouselAutoscroll({</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">interval:</span><span style="line-height: 125%;"> </span><span style="color: #3677a9; line-height: 125%;">3000</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">target:</span><span style="line-height: 125%;"> </span><span style="color: #ed9d13; line-height: 125%;">'+=1'</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">autostart:</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">true</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">})</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">;</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}),</span><span style="line-height: 125%;">
</span><span style="color: #24909d; line-height: 125%;">Function</span><span style="color: #d0d0d0; line-height: 125%;">.createDelegate(</span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">this</span><span style="color: #d0d0d0; line-height: 125%;">,</span><span style="line-height: 125%;"> </span><span style="color: #6ab825; font-weight: bold; line-height: 125%;">function</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">()</span><span style="line-height: 125%;"> </span><span style="color: #d0d0d0; line-height: 125%;">{</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">$(</span><span style="color: #ed9d13; line-height: 125%;">".loader"</span><span style="color: #d0d0d0; line-height: 125%;">).hide();</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">alert(args.get_message());</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}));</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span><span style="color: #d0d0d0; line-height: 125%;">}</span><span style="line-height: 125%;">
</span></pre>
</td></tr>
</tbody></table>
</div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">
</span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">Here is the final result :</span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_DcWI1Pv0Fr_ap8UzlRnk4f7H3YF_21ngWSKO3zrGlbKEcDkY4G0MAYG4S3Ph0B22Bhr9tsviHG4HzyRFsXhhR2IYbKG_Q0dEt8bWIolJCZxzIBwSAnTKNY7qsoVz6yBlrYOopgHMmM/s1600/2014-09-25_1621.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0_DcWI1Pv0Fr_ap8UzlRnk4f7H3YF_21ngWSKO3zrGlbKEcDkY4G0MAYG4S3Ph0B22Bhr9tsviHG4HzyRFsXhhR2IYbKG_Q0dEt8bWIolJCZxzIBwSAnTKNY7qsoVz6yBlrYOopgHMmM/s1600/2014-09-25_1621.png" height="315" width="640" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;"><br /></span></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="line-height: 20px;">Happy SharePointing hope this article helps you.</span></span></div>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-61155457169930821482014-09-25T10:24:00.000+03:002014-09-25T10:25:06.392+03:00SharePoint Online [Office 365] - Enable Anonymous users to Add items to list<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">I was recently implementing on SharePoint Online, which is a
very good escape for content and publishing portals and Internet facing sites
for Small & Medium enterprises which cannot afford the SharePoint Server
licensing, with two alternative plans starting from 4$/month which is
affordable for such business types.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">We’ll have a series of articles of some challenges faced during
the implementation to spread this knowledge, Specially that the term <b><u>SaaS</u>
“Software as a Service”</b> is trending and Microsoft is pushing towards Apps,
cloud and for sure devices J.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">The first Site Collections you have after registering for an
Office 365 plan in SharePoint, SharePoint Public Site [Publishing Site], Team
Site and search center with so many and many service applications configured
and ready to go.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Mostly we will have interest for the SharePoint Public Site,
as this is the site type that you can go online with, and enable anonymous
users to access it, But in SharePoint online enabling anonymous access is just
a button “Make this site online” J,
You do not have the ability to set the anonymous access policy as you can do on
SharePoint Server version, Even you cannot grant [Add Items], Even if you tried
using SPO PS “SharePoint Online Power Shell”.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">So a simple task like “Contact Us” form, creating a list
with a form enabling users to add some data to the list would look like it is
impossible. Then here comes the power of Apps J.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">In SharePoint online the first thing you do before
implementing any customization, have this Question “<b>Is there an App for
that??!</b>” for most common tasks you will find an app for what you want to
implement, Do not invest effort even time reinventing the wheel J.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Let’s get back on rails, What if the data we want to collect
is a custom data, let’s get introduced to “<b>Office 365 Anonymous Access /
SharePoint 2013 Sandbox Solution</b>” it is a Sandbox solution to manage
anonymous access on Office 365 / SharePoint 2013.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">OK. This is simple, Get the wsp, upload it to solution gallery
then ……….. No , There is no solution gallery link under Site Settings J, Microsoft is hiding the link , But they
did not prevent access to the page , So navigate to your Gallery by “ <a href="https://youroffice365domain-public.sharepoint.com/_catalogs/solutions/Forms/AllItems.aspx">https://yourOffice365Domain-public.sharepoint.com/_catalogs/solutions/Forms/AllItems.aspx</a>
“ and yup you will be able to Upload the solution and activate it.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Note: </b>By default you will find this message “<span style="color: #444444; font-size: 10pt;">Your
resource quota is <b><u>0</u></b> server resources. Solutions can consume
resources and may be temporarily disabled if your resource usage exceeds your
quota.</span> “ message, So you need to allocate some server resources to the
Public Site to be able to execute your packages:</span></div>
<ol style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;">Go to the SharePoint
Administration Panel<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1ic98TdyU514vEKmJrI9-vFpZAT7MOJz34gMpTpZDGvelOCqdVpQIiR9PvEEtFbzTLhAKRfAEAvMT7fdG1oEHKAdBTPb1AjbzL7uAnK5RD3Xm0dtJwNh7ytrfkO3JemXDHue_Il0s3Ws/s1600/1.png" imageanchor="1" style="font-family: 'Times New Roman'; margin-left: 1em; margin-right: 1em; text-align: center; text-indent: 0px;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1ic98TdyU514vEKmJrI9-vFpZAT7MOJz34gMpTpZDGvelOCqdVpQIiR9PvEEtFbzTLhAKRfAEAvMT7fdG1oEHKAdBTPb1AjbzL7uAnK5RD3Xm0dtJwNh7ytrfkO3JemXDHue_Il0s3Ws/s1600/1.png" /></a></span><span style="font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;"></span></li>
<li><span style="text-indent: -0.25in;"><span style="font-size: 11pt;"><span style="font-family: Arial, Helvetica, sans-serif;">Then select your public site collection, and select
Server Resource Quota.</span></span><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjs21k38oMuFUJwC7jja_SrAgKXvCshQ9Sk-2EF6IZDaMviuULSNdF6cE0B9rifd1OtZ-CfVXtyfB1ei4JeKLXF-JTDEIohDltEWXE_v4ez9MGv3mAlyNvOF_CA4SgZzUusyBaaJkGGu4/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center; text-indent: 0px;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjs21k38oMuFUJwC7jja_SrAgKXvCshQ9Sk-2EF6IZDaMviuULSNdF6cE0B9rifd1OtZ-CfVXtyfB1ei4JeKLXF-JTDEIohDltEWXE_v4ez9MGv3mAlyNvOF_CA4SgZzUusyBaaJkGGu4/s1600/2.png" height="85" width="400" /></a></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;">Then assign some quota to
the site collection<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirXK0138r2oRcdV5LUa6MKF_YRhlYSVqNn2j1vHQN0swQkgqluN6DI9r_EGly57sMaidRD7RE9gYa5uCCOv4zUthyphenhyphenh7Ny6-rXSerNz7ccIA2aRlOhNK3EinRcPr9x3s8uOJHumE15LmZ4/s1600/3.png" imageanchor="1" style="font-family: 'Times New Roman'; margin-left: 1em; margin-right: 1em; text-align: center; text-indent: 0px;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirXK0138r2oRcdV5LUa6MKF_YRhlYSVqNn2j1vHQN0swQkgqluN6DI9r_EGly57sMaidRD7RE9gYa5uCCOv4zUthyphenhyphenh7Ny6-rXSerNz7ccIA2aRlOhNK3EinRcPr9x3s8uOJHumE15LmZ4/s1600/3.png" height="270" width="320" /></a></span></li>
</ol>
<div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">After activating the sandboxed solution, Navigate to your
list and in the List tab, click on Anonymous Access</span><o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaIpwYyks_G2i1GIKVwXA0i-oKXbd5Ei8o7urhrfLTl0NOxxs5vdg3GONacudHWT1sOgPL4NnskVdgDwi5AwOiysUea_ai7RZjTbPXsnClLhbRiPG7XzLMYGT2CLMBQoNUhoBwmqKWJ3Q/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjaIpwYyks_G2i1GIKVwXA0i-oKXbd5Ei8o7urhrfLTl0NOxxs5vdg3GONacudHWT1sOgPL4NnskVdgDwi5AwOiysUea_ai7RZjTbPXsnClLhbRiPG7XzLMYGT2CLMBQoNUhoBwmqKWJ3Q/s1600/4.png" height="139" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Then select </span> “<span style="background: white; color: #676767; font-family: "Verdana","sans-serif"; font-size: 8.5pt;">Allow anonymous users to
add items to this list</span>”<o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvAIiytEASq1D9EXQt6qge4bmPMSB6snMuXxqErH51y9AzjZDmrLC_yJs3ENAs9vRXdA_04y4VRoyOX0Q3TE-s2qWwih-vLesubL7YQpxgdwIXutyBr1jlEQNQzx76a_b-cbEEUd31EFM/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvAIiytEASq1D9EXQt6qge4bmPMSB6snMuXxqErH51y9AzjZDmrLC_yJs3ENAs9vRXdA_04y4VRoyOX0Q3TE-s2qWwih-vLesubL7YQpxgdwIXutyBr1jlEQNQzx76a_b-cbEEUd31EFM/s1600/5.png" height="326" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Now you can develop a form using SharePoint Apps, or
Sandboxed solution to add the data to the list and anonymous users will be able
to submit the data.<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Note: </b>I’ve<b> </b>tried to Using ECMA script for the
form but it was not working with anonymous users, after having a call with
Microsoft Support Engineer I was informed that is not allowed by Design !! , I
am still investigating for it J</span><o:p></o:p></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="MsoNormal">
<br /></div>
</div>
<br />
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><o:p></o:p></div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-48685860618621490052014-04-24T15:32:00.002+02:002014-04-24T15:33:29.168+02:00Enable or disable custom ribbon button in SharePoint 2013 based on List Item Property [ Field Value ]<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Verdana, sans-serif;">You would come to some scenarios in SharePoint where you want to create a ribbon custom action to perform some custom tasks to meet your business needs.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Creating a custom action in SharePoint 2013 is not different than SharePoint 2010, and there are a lot of articles explaining how to create a custom action.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Examples:</span><br />
<br />
<ol style="text-align: left;">
<li><span style="font-family: Verdana, sans-serif;"><a href="http://tomaszrabinski.pl/wordpress/2012/02/25/sharepoint-2010-custom-ribbon-button/" target="_blank">SharePoint 2010 Custom Ribbon Button</a></span></li>
</ol>
<div>
<span style="font-family: Verdana, sans-serif;">What about disabling this button when a specific condition is true, The most common example you will find is disabling the ribbon button while more than on list item is selected.</span></div>
<div>
<ol style="text-align: left;">
<li><span style="font-family: Verdana, sans-serif;"><a href="http://msdn.microsoft.com/en-us/library/office/ff458385(v=office.15).aspx" target="_blank">CommandUIHandler Element</a></span></li>
<li><a href="http://tomaszrabinski.pl/wordpress/2012/02/25/enable-or-disable-custom-ribbon-button-in-sharepoint-2010/" target="_blank"><span style="font-family: Verdana, sans-serif;">Enable or disable custom ribbon button in SharePoint 2010</span></a></li>
</ol>
<div>
<span style="font-family: Verdana, sans-serif;">But what about disabling the custom action based on a field value in the currently selected list item, For example in the Check-in & Check-out buttons in the ribbon is disabled/Enabled based on the Document [Item] Status.</span></div>
</div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">Ok, Then how would you apply the same idea based on your own custom field.</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">Here comes the magic of using CSOM and ECMA scripts to communicate asynchronously with current list, Getting the current list item fields, then deciding based on the field value if you will Enable/Disable the button.</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">In the Custom action elements.xml definition you will find a section with the following tag "<b>CommandUIHandler</b></span><span style="font-family: Verdana, sans-serif;">", This tag has "</span><span style="font-family: Consolas, Courier, monospace; font-size: 14px; line-height: 20.005998611450195px;"><b>EnabledScript</b>"</span><span style="font-family: Verdana, sans-serif;"> attribute, Where you can right javascript to return true if enabled, False if the button is disabled.</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">First you need to check if only one item is selected:</span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"></span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><span style="font-family: Verdana, sans-serif;"><code>function singleStatusEnable() {
try{
var selecteditems = SP.ListOperation.Selection.getSelectedItems();
var ci = CountDictionary(selecteditems);
if (ci == 1) {
return CheckStatus(selecteditems);
}
else {
return false;
}
}
catch (ex) {
alert('Error occurred: ' + ex.message);
return false;
}
}
</code></span></pre>
</div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">Then we will have the following plan, We will create a global window variable of array type, To maintain the values of the EnabledScript.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">We will use the array index as the ItemID and the value will be either true or false, Why we will do this ?? Simply to not have to check the Item Field value each type the user check/uncheck the item, as each time the item is checked or unchecked the method "RefreshCommandUI()" is called which re-validates all the ribbon buttons to decide wither to enable or disable them according to current selected Item.</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">If the global window variable is not defined we will initialize it - This will happen only with first selected item - Then we will check if the current item ID already exists in our array if yes we will return the value</span>
<span style="font-family: Verdana, sans-serif;">if not we will check the value </span><span style="font-family: Verdana, sans-serif;">asynchronously, after we get the response back from the server we will call the </span><span style="font-family: Verdana, sans-serif;">"RefreshCommandUI()" method to re-validate the ribbon buttons</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"></span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><span style="font-family: Verdana, sans-serif;"><code>function CheckStatus(selectedItems) {
//Get Current Context
var clientContext = SP.ClientContext.get_current();
//Get Current List
var currentList = clientContext.get_web().get_lists().getById(SP.ListOperation.Selection.getSelectedList());
//Get Selected List Item
var ItemId = selectedItems[0].id;
//Check if the window global array variable was initialized or not
if(window.FolderStatusValue === undefined) {
window.FolderStatusValue = new Array();
}
//Check if the current selected ID was previously saved if not Get the Item status and refresh the UI
if (window.FolderStatusValue[ItemId] === undefined) {
singleItem = currentList.getItemById(ItemId);
clientContext.load(singleItem);
clientContext.executeQueryAsync(Function.createDelegate(this, OnSucceeded), Function.createDelegate(this, OnFailed));
return false;
}
//Return the saved value
return window.FolderStatusValue[ItemId];
}
//When the Async request is completed save the Item value in the array and re-call RefreshCom//mandUI() method
function OnSucceeded() {
var selecteditems = SP.ListOperation.Selection.getSelectedItems();
var ItemId = selecteditems[0].id;
var ItemStatus = singleItem.get_item('YOUR-CUSTOM-COLUMN-STATIC-NAME');
if (ItemStatus) {
window.FolderStatusValue[ItemId] = true; //Enable Ribbon button
RefreshCommandUI();
}
else {
window.FolderStatusValue[ItemId] = false; //Disable Ribbon button
}
}
function OnFailed(sender, args) {
alert('Error occurred: ' + args.get_message());
return false;
}
</code></span></pre>
<br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;">Here is the full XML definition for the Custom Action :</span><br />
<span style="font-family: Verdana, sans-serif;"><br /></span>
<span style="font-family: Verdana, sans-serif;"><!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</span></div>
</div>
<span style="font-family: Verdana, sans-serif;"></span><br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><span style="font-family: Verdana, sans-serif;"><code><?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="8d2b47c5-9e1a-4ff2-9a90-071632a0e9db.ShareFolderExternal"
RegistrationType="ContentType"
RegistrationId="0x0120001D4A61CCFCF04620B4F487A48EABBD52"
Location="CommandUI.Ribbon"
Rights="AddListItems,DeleteListItems,EditListItems">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.Documents.Share.Controls._children">
<Button
Id="8d2b47c5-9e1a-4ff2-9a90-071632a0e9db.ShareFolderExternal.Button"
Command="ShareFolderExternally"
Image16by16="/_layouts/15/images/Share16x16.png"
Image32by32="/_layouts/15/images/Share32x32.png"
LabelText="$Resources:DocumentSharing,ShareFolderCA;"
TemplateAlias="o1"
Sequence="11" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="ShareFolderExternally"
CommandAction="Javascript:
function Operation(dialogResult, returnValue)
{
SP.UI.Notify.addNotification('Successfully Done!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
var webURL = _spPageContextInfo.webServerRelativeUrl;
var selecteditems = SP.ListOperation.Selection.getSelectedItems();
var ItemId = selecteditems[0].id;
var options = {
url: webURL + '/_layouts/15/Progress.aspx?FolderId=' + ItemId + '&amp;ListId={ListId}',
title: 'Share Folder Externally',
allowMaximize: false,
showClose: true,
width: 400,
height: 100,
dialogReturnValueCallback: Operation
};
SP.UI.ModalDialog.showModalDialog(options);"
EnabledScript="javascript:
var singleItem;
function singleStatusEnable() {
try{
var selecteditems = SP.ListOperation.Selection.getSelectedItems();
var ci = CountDictionary(selecteditems);
if (ci == 1) {
return CheckStatus(selecteditems);
}
else {
return false;
}
}
catch (ex) {
alert('Error occurred: ' + ex.message);
return false;
}
}
function CheckStatus(selectedItems) {
var clientContext = SP.ClientContext.get_current();
var currentList = clientContext.get_web().get_lists().getById(SP.ListOperation.Selection.getSelectedList());
var ItemId = selectedItems[0].id;
if(window.FolderStatusValue === undefined) {
window.FolderStatusValue = new Array();
}
if (window.FolderStatusValue[ItemId] === undefined) {
singleItem = currentList.getItemById(ItemId);
clientContext.load(singleItem);
clientContext.executeQueryAsync(Function.createDelegate(this, OnSucceeded), Function.createDelegate(this, OnFailed));
return false;
}
return window.FolderStatusValue[ItemId];
}
function OnSucceeded() {
var selecteditems = SP.ListOperation.Selection.getSelectedItems();
var ItemId = selecteditems[0].id;
var ItemStatus = singleItem.get_item('YOUR-CUSTOM-COLUMN-STATIC-NAME');
if (ItemStatus) {
window.FolderStatusValue[ItemId] = true;
RefreshCommandUI();
}
else {
window.FolderStatusValue[ItemId] = false;
}
}
function OnFailed(sender, args) {
alert('Error occurred: ' + args.get_message());
return false;
}
singleStatusEnable();
" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>
</code></span></pre>
<span style="font-family: Verdana, sans-serif;"><div>
<span style="font-family: Verdana, sans-serif;"><br /></span></div>
Hope you find this article useful, Happy SharePointing :)</span>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com2tag:blogger.com,1999:blog-7265446347879207534.post-54344416265312061352014-04-20T10:46:00.000+02:002014-04-20T10:46:50.041+02:00SharePoint 2013 - Document Library and Custom Field Type<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white; color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;">We created a very simple custom field control to filter some custom data from SQL database, and the code behind is only the necessary constructors and one overload. We created a custom content type that inherits from Folder, and associate our site column/field type to the new content type. We then add that content type to a Document Library, and when we attempt to create the new 'folder' (our content type), it has only two columns: Name and My Custom Field. When we try to save it, Name blanks out and doesn't give us any information, validation error or exception. It just won't allow us to save. Weird !!!!</span><br />
<span style="background-color: white; color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="background-color: white; font-size: 15px; line-height: 19.5px;">After some googling and search I've found that great blog </span><span style="font-size: 15px; line-height: 19.5px;"><a href="http://blogs.msdn.com/b/sridhara/archive/2013/07/26/custom-field-types-and-rendering-templates-correlation-with-the-new-server-render-property-of-the-listformwebpart.aspx" target="_blank">Custom field types and rendering templates correlation with the new “Server Render” property of the ListFormWebPart</a> .</span></span><br />
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><span style="color: #222222;">In this article you will find that the problem is that my custom field type is using Server Rendering template, While SharePoint 2013 document library ListFormWebPart is using CSR</span><span style="color: #333333;"> [</span></span></span><span style="background-color: white;"><a href="http://msdn.microsoft.com/en-us/library/jj220061.aspx" style="color: #0066dd; cursor: pointer; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18.165599822998047px; outline: none; text-decoration: none;" target="_blank">Client-Side Rendering</a></span><span style="color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;"><span style="background-color: white;">]</span> .</span><br />
<span style="color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;"><br /></span>
<span style="color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;">Then you have a solution, by following the </span><span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">Sridhar's article by editing the New & Edit form for your library changing the </span></span><span style="color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;">ListFormWebPart</span><span style="color: #222222; font-family: 'Segoe UI', Segoe, 'Helvetica Neue', 'Lucida Grande', Arial, sans-serif; font-size: 15px; line-height: 19.5px;"> , </span><span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">find the “CSR Render Mode” option under “Miscellaneous” section. Just choose “Server Render (ServerRender)” for the “CSR Render Mode” option .</span></span><br />
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">But what about automating this process, In my scenario I had a SharePoint Project including the field type, content type, Document library Template and List definition. All connected together</span></span><br />
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">I had a web scoped feature to provision this document library on containing this Field type.</span></span><br />
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">So what I've to do to make all this work, Is to specify </span></span><span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;">Sridhar's solution in the feature activated event receiver, The below code snippet is what you have to do to get that done:</span></span><br />
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span>
<span style="color: #222222; font-family: Segoe UI, Segoe, Helvetica Neue, Lucida Grande, Arial, sans-serif;"><span style="font-size: 15px; line-height: 19.5px;"><br /></span></span><br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">void</span> ChangeSentDocumentListFormWebPart(SPList SentDocLibList)</pre>
<pre> {</pre>
<pre class="alt"> SPDocumentLibrary SentDocLib = (SPDocumentLibrary)SentDocLibList;</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// Update forms</span></pre>
<pre> <span class="kwrd">foreach</span> (SPForm spForm <span class="kwrd">in</span> SentDocLib.Forms)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">if</span> (spForm.Url.Contains(<span class="str">"DispForm.aspx"</span>) || spForm.Url.Contains(<span class="str">"EditForm.aspx"</span>) || spForm.Url.Contains(<span class="str">"Upload.aspx"</span>))</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">string</span> fileURL = SentDocLib.ParentWeb.Url + <span class="str">"/"</span> + spForm.Url;</pre>
<pre class="alt"> SPFile page = SentDocLib.ParentWeb.GetFile(fileURL);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">using</span> (SPLimitedWebPartManager lwpm = page.GetLimitedWebPartManager(PersonalizationScope.Shared))</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">try</span></pre>
<pre> {</pre>
<pre class="alt"> <span class="rem">// Enable the Update</span></pre>
<pre> lwpm.Web.AllowUnsafeUpdates = <span class="kwrd">true</span>;</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// Check out the file, if not checked out</span></pre>
<pre class="alt"> SPFile file = lwpm.Web.GetFile(fileURL);</pre>
<pre> <span class="kwrd">if</span> (file.CheckOutType == SPFile.SPCheckOutType.None)</pre>
<pre class="alt"> file.CheckOut();</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// Find the ListFormWebPart and Update the Template Name Property</span></pre>
<pre> <span class="kwrd">foreach</span> (System.Web.UI.WebControls.WebParts.WebPart wp <span class="kwrd">in</span> lwpm.WebParts)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">if</span> (wp <span class="kwrd">is</span> Microsoft.SharePoint.WebPartPages.ListFormWebPart)</pre>
<pre class="alt"> {</pre>
<pre> Microsoft.SharePoint.WebPartPages.ListFormWebPart lfwp =</pre>
<pre class="alt"> (Microsoft.SharePoint.WebPartPages.ListFormWebPart)wp.WebBrowsableObject;</pre>
<pre> lfwp.CSRRenderMode = CSRRenderMode.ServerRender;</pre>
<pre class="alt"> lwpm.SaveChanges(lfwp);</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// Update the file</span></pre>
<pre> file.Update();</pre>
<pre class="alt"> file.CheckIn(<span class="str">"System Update"</span>);</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// Disable the Unsafe Update</span></pre>
<pre> lwpm.Web.AllowUnsafeUpdates = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">finally</span></pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">if</span> (lwpm.Web != <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> lwpm.Web.AllowUnsafeUpdates = <span class="kwrd">false</span>;</pre>
<pre class="alt"> </pre>
<pre> lwpm.Web.Dispose(); <span class="rem">// SPLimitedWebPartManager.Web object Dispose() called manually</span></pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com1tag:blogger.com,1999:blog-7265446347879207534.post-68927322515018752312014-01-27T17:14:00.001+02:002014-01-27T17:19:18.095+02:00SharePoint 2013 - Update Search Navigation Nodes for all Sitecollections & subwebs in your Web Application<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Search navigation links represents the search result pages
in SharePoint Search center. By default we have four search results pages in
SharePoint search center, "Everything", "People",
"Conversations", and "Videos" as shown in image below.</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Those options are Shown as tabs in your search center </span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_i1025" type="#_x0000_t75"
alt="" style='width:381.75pt;height:60.75pt'>
<v:imagedata src="file:///C:\DOCUME~1\ISLAM~1.KHA\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png"
o:href="cid:image001.png@01CF1B82.49312650"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7IWNBUuxiq-VUyXnQ4RnjKriIwFcdG3ebpXFi-ksb2MamgEkGwlAmEGOvi5Ujwll9fmqNjMXIGuubFzWza9Twftdr-2K9WyGMciqypE-SAo0KeEENhgDYdvDYi9FAcJhlhA8FMDLmJOk/s1600/Taps.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7IWNBUuxiq-VUyXnQ4RnjKriIwFcdG3ebpXFi-ksb2MamgEkGwlAmEGOvi5Ujwll9fmqNjMXIGuubFzWza9Twftdr-2K9WyGMciqypE-SAo0KeEENhgDYdvDYi9FAcJhlhA8FMDLmJOk/s1600/Taps.png" height="100" width="640" /></a></span></div>
<br />
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">or as a drop down in your search box </span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcvhRz_066UxzpA_givSIHDfxGxeNUfFYiI8oVSUvgiPgZNr1TK1fqFzt5gMvzIHsBFzPGEJbvI6HtZlB59kVwCuTClgEOTWDtifMK9jqAdTBI2IFY6Kgw_jkvuH-ixcf-B3TWhlaFVMo/s1600/DDL.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcvhRz_066UxzpA_givSIHDfxGxeNUfFYiI8oVSUvgiPgZNr1TK1fqFzt5gMvzIHsBFzPGEJbvI6HtZlB59kVwCuTClgEOTWDtifMK9jqAdTBI2IFY6Kgw_jkvuH-ixcf-B3TWhlaFVMo/s1600/DDL.png" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /><!--[endif]--></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">But if you added your own result pages that are linked to
specific result sources or query rules, You have to add the new pages to your
search navigation settings per each webapplication</span></div>
<div class="MsoNormal">
<a href="http://www.sharepoint2013.me/Blog/Post/143/N%E2%80%8Bew-search-navigation-link-in-SharePoint-2013-Search"><span style="font-family: Arial, Helvetica, sans-serif;">http://www.sharepoint2013.me/Blog/Post/143/N%E2%80%8Bew-search-navigation-link-in-SharePoint-2013-Search</span></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">What if you have a Mulit-Site collection , Mullti-Webs
Structure hierarchy … In the subweb search settings you will find that search settings
have an option “Use the same results page settings as my parent”, But this will
inhirit the search settings only not the search navigation links as the links
are SPNavigationNode object, </span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /><!--[endif]--></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPemUX80NXPB2rt-UMVHbl6DxHjzsOIy8wxqZy8kyLlauLqAINDYDkoB-ZczIgpy29Fr7AUH20IW3Zh3dmw4lR2s6mK0dqegylOYDX9gFw0LitmL1DWvb33PXQknE-74wESRHXfk4SOtg/s1600/Options.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPemUX80NXPB2rt-UMVHbl6DxHjzsOIy8wxqZy8kyLlauLqAINDYDkoB-ZczIgpy29Fr7AUH20IW3Zh3dmw4lR2s6mK0dqegylOYDX9gFw0LitmL1DWvb33PXQknE-74wESRHXfk4SOtg/s1600/Options.png" height="328" width="640" /></a></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">So you will have to do this task manually…. Or just code it</span></div>
<div class="MsoNormal">
<br /></div>
<br />
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">I have written a powershell script file to update all the
webs "<a href="https://dl.dropboxusercontent.com/u/85947428/UpdateSearchNav.rar" target="_blank">DOWNLOAD FILE HERE</a>", sites within your web application, In my case we have added
new search results pages “Events”, “File Share” …etc…. So manipulate the URLs
the titles to meet your needs</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">The Code:</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
</div>
<pre class="brush:powershell">function Update-SearchNav([string]$Identity)
{
Write-Host -ForegroundColor Red "============================================="
Write-Host -ForegroundColor Green "Updating Search Navigation at URL " -NoNewline;
Write-Host -ForegroundColor Green $Identity
$s = Get-SPSite $Identity
$w = $s.RootWeb
foreach ($w in $s.AllWebs) {
Write-Host -ForegroundColor Red "============================================="
Write-Host -ForegroundColor Green "Updating Search Navigation at URL " -NoNewline;
Write-Host -ForegroundColor Green $w.Url
$SearchNav = $w.Navigation.SearchNav
IF ($SearchNav -ne $NULL)
{
Write-Host -ForegroundColor Red "This Site Search Navigation Already containing values";
}
ELSE
{
Write-Host -ForegroundColor Red "Search Navigation was not found";
Write-Host -ForegroundColor Green "Adding Search Navigation Everything";
$Title = "Everything"
$RelativeUrl = "/sites/SearchCentre/pages/results.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation Events";
$Title = "Events"
$RelativeUrl = "/sites/SearchCentre/Pages/events.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation People";
$Title = "People"
$RelativeUrl = "/sites/SearchCentre/Pages/peopleresults.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation Conversation";
$Title = "Conversation"
$RelativeUrl = "/sites/SearchCentre/Pages/conversationresults.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation File Share";
$Title = "File Share"
$RelativeUrl = "/sites/SearchCentre/Pages/FileShare.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation Videos";
$Title = "Videos"
$RelativeUrl = "/sites/SearchCentre/Pages/videoresults.aspx"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
Write-Host -ForegroundColor Green "Adding Search Navigation This Section";
$Title = "This Section"
$RelativeUrl = $w.ServerRelativeUrl + "/_layouts/15/osssearchresults.aspx?u={contexturl}"
$node = new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $Title, $RelativeUrl, $true
$w.Navigation.SearchNav.AddAsLast($node)
}
Write-Host -ForegroundColor Red "============================================="
}
$w.Dispose()
$s.Dispose()
Write-Host -ForegroundColor Red "============================================="
}
#TODO Add Your Web Application URL
$WebApplication = Get-SPWebApplication http://webapplicationurl
Foreach ($Sites in $WebApplication.Sites)
{
Update-SearchNav($Sites.url.trim())
Write-Host "Press any key to continue ..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
</pre>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com7tag:blogger.com,1999:blog-7265446347879207534.post-30926680923868034872014-01-26T21:43:00.000+02:002014-01-28T10:53:38.361+02:00Custom Sitemap provider in SharePoint does not show n-level :@<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Arial, Helvetica, sans-serif;">Another <b><u>genius</u></b> SharePoint <b><u>limitation</u></b>
or issue , If you want to implement your own custom site map provider, To
implement your own Sitemap provider on SharePoint you will have to inherit from
the following class :</span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">Microsoft.SharePoint.Publishing.Navigation.
PortalSiteMapProvider</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">Then you will have to
override the following method</span></span></li>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif; text-indent: -0.25in;">public override SiteMapNodeCollection GetChildNodes(SiteMapNode
node)</span></li>
</ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">After implementing your
custom logic with a static or recursive algorithm (In my case was a recursive
algorithm to get all navigation terms from Managed Metadata Service in a
specific term set), You will find that only 2 levels are showing in the top
navigation menu ….weiiiiird</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">Ok google it… you will find
that this maybe an issue in the <SharePoint:Aspmenu> control in your
masterpage which contains a property called MaximumDynamicDisplayLevels,,,
OOOOH this maybe my life saver…. :@ but no SharePoint will not make your life
that easy.</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">Playing around with this
property and other properties like StaticDisplayLevels but in vain .</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">So what is happening in the
background … Time to reflect some code</span></span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;"><span style="text-indent: -0.25in;">-</span><span style="font-size: 7pt; text-indent: -0.25in;">
</span><span dir="LTR" style="text-indent: -0.25in;"></span><span style="text-indent: -0.25in;">Reflecting the
Microsoft.SharePoint.Publishing.Navigation. PortalSiteMapProvider class …
Here you will have following </span><b style="text-indent: -0.25in;">surprise</b></span></li>
</ul>
<!--[if !supportLists]--><br />
<div class="MsoListParagraph">
<!--[if gte vml 1]><v:shapetype id="_x0000_t75"
coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe"
filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="_x0000_i1025" type="#_x0000_t75" alt="" style='width:803.25pt;
height:510pt'>
<v:imagedata src="file:///C:\DOCUME~1\ISLAM~1.KHA\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png"
o:href="cid:image002.png@01CF1ADE.89ACD160"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></div>
<div class="MsoListParagraph">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2mq67dpQUnwnsmajCfhtbqC1rCF2Bwa_z0467t3VigQ_BE8LYlTQLQDZT1sfMoXdQmI5_kwbBPqr8GiAAAVfnwGJYA0jvHO6e13ml1mlJHnSDvIbvOahW-FhZC3nrtCyGSIuqT7WPhuc/s1600/2014-01-26_2133.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2mq67dpQUnwnsmajCfhtbqC1rCF2Bwa_z0467t3VigQ_BE8LYlTQLQDZT1sfMoXdQmI5_kwbBPqr8GiAAAVfnwGJYA0jvHO6e13ml1mlJHnSDvIbvOahW-FhZC3nrtCyGSIuqT7WPhuc/s1600/2014-01-26_2133.png" height="404" width="640" /></a></div>
<br />
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt;">
</span><!--[endif]--><span dir="LTR"></span><span style="font-family: Arial, Helvetica, sans-serif;">Yes you are seeing it
right, Microsoft engineers for some <b>UNKNOWN</b> reason had decided to <b>HARDCODE</b>
the MaximumSupportedNodeDepth as a <b>PROTECTED</b> property to be <b>UNACCESSABLE</b>
.</span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Arial, Helvetica, sans-serif;">-<span style="font-size: 7pt;">
</span><!--[endif]--><span dir="LTR"></span>Now implement your logic
but this time inherit for the classic System.Web.StaticSiteMapProvider
implement the following methods:</span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span dir="LTR"></span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">public</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">override</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">SiteMapNode</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> BuildSiteMap()</span></div>
<div class="MsoListParagraph" style="margin-left: 1.0in; mso-list: l0 level2 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">o<span style="font-family: 'Times New Roman'; font-size: 7pt;"> </span></span><!--[endif]--><span dir="LTR"></span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">protected</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: blue; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">override</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> </span><span style="background: white; color: #2b91af; font-family: Consolas; font-size: 9.5pt; mso-highlight: white;">SiteMapNode</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Consolas; font-size: 9.5pt;"> GetRootNodeCore()</span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->-<span style="font-size: 7pt;">
</span><!--[endif]--><span dir="LTR"></span><span style="font-family: Arial, Helvetica, sans-serif;">You now have your own
customized top navigation site map provider supporting n-level hierarchy </span></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<br />
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Arial, Helvetica, sans-serif;">-<span style="font-size: 7pt;">
</span><!--[endif]--><span dir="LTR"></span>Happy SharePointing :)</span></div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-71566488709672795612013-04-23T14:16:00.001+02:002014-06-26T09:45:36.693+03:00SharePoint 2013 Multilingual User Interface (MUI) Switcher<div dir="ltr" style="text-align: left;" trbidi="on">
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
In SharePoint Foundation 2010, when someone navigates to a multilingual website, the website uses the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4" target="_blank">Accept-Language</a>
header that the client browser sends with the HTTP request to determine
the language in which to render the user interface. If the website does
not support any of the languages specified by the browser, the default
language is used as the display language<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
A multilingual website
also displays a drop-down menu in the upper-right corner of the page,
next to the user's name, where users can select a display language. When
someone selects a language that is different from the current display
language, the website switches to the new language. The user's
preference is persisted in a cookie that is dropped on the client
computer. The website gets the user's language preference from the
cookie on subsequent visits to the site.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: center;"><tbody>
<tr><td style="text-align: center;"><br /></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
But In SharePoint 2013 the language switcher drop
down is removed ... So We have tried to implement our own switcher with
same concept in SharePoint 2010 - Reference the <a href="http://msdn.microsoft.com/en-us/library/ff800886%28v=office.14%29.aspx" target="_blank">Changing the Display Language </a>- But trying to add the JavaScript was useless.<br />
<br />
<span class="LW_CollapsibleArea_Title">So we tried another approach ...
Using an HTTP Module which interrupts the request in a very early stage -
Reference this Page to see <a href="http://sacarter.wordpress.com/2012/08/06/add-httpmodule-to-sharepoint/" target="_blank">how to create and apply an HTTPModule to SharePoint</a> - .</span><br />
<br />
<span class="LW_CollapsibleArea_Title">The trick is the new SharePoint
model for changing the display language is by checking the user's
language preferences ... Then adding those languages to the request
header in the Accept-Language tag i.e. ar-SA,en-US or buy the language
preferences the user configures in his SharePoint user profile. </span><br />
<span class="LW_CollapsibleArea_Title"> </span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjo3Gbm0pBWT-hTeA3IXAMWbl1Tgw3cRf93PPHWFDY1gTQAftDxfk_i4pOVvb6tbGrx41PR9yY1cMPuJ7CQbG1VebU38O3WLvvchSIcQ0ZgV6A5PIJZWB8ZbLHHrlVmKUC5UuWLFR3KSA/s1600/2013-04-22_1551.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjo3Gbm0pBWT-hTeA3IXAMWbl1Tgw3cRf93PPHWFDY1gTQAftDxfk_i4pOVvb6tbGrx41PR9yY1cMPuJ7CQbG1VebU38O3WLvvchSIcQ0ZgV6A5PIJZWB8ZbLHHrlVmKUC5UuWLFR3KSA/s640/2013-04-22_1551.png" height="118" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">English Preference Only</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBPb-0hnZHeXnCQQNWbG6IZl35jh2vSTKmcO08BwP6cE68U_F38tH5pUKY1gv1sg_e0f-KH1QHeFFTLLGpC70xVdBIt9de-hJPBD-90SBlfR-z_fBaKtTlz3-473cZgWjN7B0ssuRo_gk/s1600/2013-04-22_1551_001.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBPb-0hnZHeXnCQQNWbG6IZl35jh2vSTKmcO08BwP6cE68U_F38tH5pUKY1gv1sg_e0f-KH1QHeFFTLLGpC70xVdBIt9de-hJPBD-90SBlfR-z_fBaKtTlz3-473cZgWjN7B0ssuRo_gk/s640/2013-04-22_1551_001.png" height="118" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Arabic then English Preference </td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<span class="LW_CollapsibleArea_Title">OK
... we will not reinvent the wheel ... The game plan is to interrupt
the request and check for the cookies value - Assuming we have a cookie
preserving the current selected language - Adding the selected language
at the to the request header using an HTTP Handler , Then setting the
current thread culture to the selected language, By implementing the <strike>PreSendRequestHeaders</strike> event handler.</span><br />
<span class="LW_CollapsibleArea_Title"><br /></span>
<span class="LW_CollapsibleArea_Title"><span style="background-color: yellow;"><b><i>UPDATE:</i></b></span> Thanks to Suleman, many people was facing some issues in this approach, He found using the PreRequestHandlerExecute event handler solves all issues</span><br />
<span class="LW_CollapsibleArea_Title"><br /></span>
<span class="LW_CollapsibleArea_Title">e.g context.PreRequestHandlerExecute +=context_PreRequestHandlerExecute;</span><br />
<span class="LW_CollapsibleArea_Title"></span><br />
<br />
<span class="LW_CollapsibleArea_Title">Following is the code we used for achieving the above scenario by setting the language to arabic:</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">using</span> System;</pre>
<pre><span class="kwrd">using</span> System.Collections.Generic;</pre>
<pre class="alt"><span class="kwrd">using</span> System.Linq;</pre>
<pre><span class="kwrd">using</span> System.Text;</pre>
<pre class="alt"><span class="kwrd">using</span> System.Web;</pre>
<pre><span class="kwrd">using</span> System.Threading.Tasks;</pre>
<pre class="alt"><span class="kwrd">using</span> System.Threading;</pre>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: left; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: left; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: left; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: left; margin-bottom: 1em; text-align: center;"><tbody>
<tr><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<pre> </pre>
<pre class="alt"><span class="kwrd">namespace</span> MUISwitcher</pre>
<pre>{</pre>
<pre class="alt"> <span class="kwrd">class</span> HTTPSwitcherModule : IHttpModule</pre>
<pre> {</pre>
<pre class="alt"> <span class="preproc">#region</span> IHttpModule Members</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">public</span> <span class="kwrd">void</span> Dispose()</pre>
<pre> {</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">public</span> <span class="kwrd">void</span> Init(HttpApplication context)</pre>
<pre> {</pre>
<pre class="alt"> context.PreRequestHandlerExecute +=context_PreRequestHandlerExecute;</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">void</span> context_PreRequestHandlerExecute(<span class="kwrd">object</span> sender, EventArgs e)</pre>
<pre class="alt"> {</pre>
<pre> HttpApplication httpApp = sender <span class="kwrd">as</span> HttpApplication;</pre>
<pre class="alt"> HttpContext context = httpApp.Context;</pre>
<pre> <span class="kwrd">string</span> httpUrl = context.Request.Url.ToString();</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">//TODO:Get the selected value for the current culture form the cookie i.e. ar-SA and </span></pre>
<pre class="alt"> <span class="rem">//set the Header and the CurrentCulture to the aquired value</span></pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">var</span> lang = context.Request.Headers[<span class="str">"Accept-Language"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!lang.Contains(<span class="str">"ar-SA"</span>))</pre>
<pre> context.Request.Headers[<span class="str">"Accept-Language"</span>] = <span class="str">"ar-SA,"</span> + context.Request.Headers[<span class="str">"Accept-Language"</span>];</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">var</span> culture = <span class="kwrd">new</span> System.Globalization.CultureInfo(<span class="str">"ar-SA"</span>);</pre>
<pre> </pre>
<pre class="alt"> Thread.CurrentThread.CurrentCulture = culture;</pre>
<pre> Thread.CurrentThread.CurrentUICulture = culture;</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> <span class="preproc">#endregion</span></pre>
<pre> }</pre>
<pre class="alt">}</pre>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com6tag:blogger.com,1999:blog-7265446347879207534.post-85931297949704967332013-04-14T14:39:00.003+02:002013-04-14T14:39:21.827+02:00Publishing Page Layout Image Field Disappears when the page is Published<div dir="ltr" style="text-align: left;" trbidi="on">
I was facing this problem that when Publishing Page Layout the Image Field Disappears when the page is Published and I found out that the page layout I was
using was not associated with the custom content type, as I was using
SharePoint designer to copy the layout from one environment to another
one, So I opened the master page gallery and edited the properties for
this layout and re-associated it with the content type , and everything
is working OK right now</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com1tag:blogger.com,1999:blog-7265446347879207534.post-40097847193621503092013-02-05T13:11:00.000+02:002013-02-05T19:02:16.904+02:00Getting the login faulire cause for TMG login using a sharepoint 2010 application page<div dir="ltr" style="text-align: left;" trbidi="on">
Microsoft Forefront Threat Management Gateway (Forefront TMG), formerly known as Microsoft Internet Security and Acceleration Server (ISA Server), is a network security and protection solution for Microsoft Windows, described by Microsoft as "enables businesses by allowing employees to safely and productively use the Internet for business without worrying about malware and other threats"<br />
<br />
SharePoint sites comprise one of the more common types of content that are secured by the Forefront Edge line. This stems from the critical need to provide remote document management while at the same time securing that access. Although Forefront UAG is the preferred solution for reverse proxy of a SharePoint environment, the Forefront TMG product is also a highly capable product that allows for reverse proxy functionality.<br />
<br />
The login page behavior for the TMG server on an invalid login trial is only to inform the user that either the user name or password is incorrect, so the user keeps trying till his account becomes locked, Even the invalid trial would be of an expired password a locked account , the user name is wrong or the password is actually wrong .<br />
<br />
You may have for you business need to specify to the user why did this trial fail.<br />
<br />
Ok, I do not have any experience in TMG, but I needed to get a workaround to solve this issue, I found that the login page for TMG is rendered from a HTML file under my TMG rule folder this file is usr_pwd.htm. a lot of people is talking about customizing this file for branding and applying your corporate look and feel style to this page, But how about changing its behavior to redirect to another page when the user fails to login to specify the failure cause.<br />
<br />
And here is the solution I managed to find - This may be not the best solution based on my limited experience in TMG but it works fine this is what we all care about in the end :) -<br />
<br />
The game play plan is as the follwing:<br />
-Once the user clicks the "Sign in" button, we will save his user name in a cookie.<br />
-The sign in button causes page post back, So in the the page load we will check if the login was not successful, then we will redirect the user to an SharePoint application page , providing this page with the cookie reserved user name in the page query string<br />
-In the application page , using some LDAB methods we will be able to find out why the user was not able to login by checking the following:<br />
<ol style="text-align: left;">
<li>First check the Lock Out Time property for the user if it is not "0" so the account is locked</li>
<li>Second check the password last set property if it is "0" so the password was not ever set by the user</li>
<li>Check the max password age property vs. the password last set property, if the time span between them both is less than zero then the password has expire </li>
<li>Else check the user account control property to get the current status of the account .</li>
</ol>
Lets start some coding....<br />
<br />
<b>- "Sign in" button, we will save his user name in a cookie</b><br />
To achive this we will edit the file "usr_pwd.htm" its path would be something like "C:\Program Files\Microsoft Forefront Threat Management Gateway\Templates\CookieAuthTemplates\{YOUR FOLDER NAME}\HTML\usr_pwd.htm"<br />
<br />
Using some helper JavaScript methods already used in the "flogon.js" file , we will add the JavaScript functions that will create the UserName cookie and get this cookie and check wither the cookies is enabled or not<br />
<br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"> function setUsernameCookie(){</pre>
<pre> <span class="kwrd">var</span> userName = getUser().value;</pre>
<pre class="alt"> <span class="kwrd">if</span> (chkCookies()) {</pre>
<pre> document.cookie=<span class="str">""</span>;</pre>
<pre class="alt"> setCookie(<span class="str">"UserName"</span>,userName,20*1000);</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span>{</pre>
<pre> alert(<span class="str">"Cookies not enabled"</span>);</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> function setCookie(c_name,value,exdays){</pre>
<pre> <span class="kwrd">var</span> exdate=<span class="kwrd">new</span> Date();</pre>
<pre class="alt"> exdate.setDate(exdate.getDate() + exdays);</pre>
<pre> <span class="kwrd">var</span> c_value=escape(value) + ((exdays==<span class="kwrd">null</span>) ? <span class="str">""</span> : <span class="str">"; expires="</span>+exdate.toUTCString());</pre>
<pre class="alt"> document.cookie=c_name + <span class="str">"="</span> + c_value;</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> function getCookie(c_name){</pre>
<pre class="alt"> <span class="kwrd">var</span> i,x,y,ARRcookies=document.cookie.split(<span class="str">";"</span>);</pre>
<pre> <span class="kwrd">for</span> (i=0;i<ARRcookies.length;i++){</pre>
<pre class="alt"> x=ARRcookies[i].substr(0,ARRcookies[i].indexOf(<span class="str">"="</span>));</pre>
<pre> y=ARRcookies[i].substr(ARRcookies[i].indexOf(<span class="str">"="</span>)+1);</pre>
<pre class="alt"> x=x.replace(/^\s+|\s+$/g,<span class="str">""</span>);</pre>
<pre> <span class="kwrd">if</span> (x==c_name)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">return</span> unescape(y);</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
</div>
As you see there is some JavaScript functions used like "getUser()" and "chkCookies()" that are already used in the "flogon.js" so we will just reuse them - We will not reinvent the wheel :)-<br />
<br />
Now we need to bind the "setUsernameCookie()" function to the onclick event that is easy , Find the input element that have the id "SubmitCreds" and add the onClick attribute as follow onClick="setUsernameCookie()"<br />
<br />
Ok step one save user name in a cookie DONE.<br />
<br />
<b>- On page load check if the login was not successful, then redirect to a SharePoint application page</b><br />
<br />
Now the user had clicked sign in, the cookie is filled with his user name, but how we will know it was an unsuccessful trial, This is the worst part that was made in the unprofessional way <b>:(</b>, but this how I managed to do it , I checked the td element that the login failure message will show in , Give it id , and in the page load checked if the message is the failure message then redirected the user .<br />
<br />
After some elements inspection I found that the failure message is in the td element with class="wrng" and the inner text is @@INSERT_USER_TEXT so i found it in the html and gave it the following id tdLoginMessage, the result will be :<br />
<br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd"><</span><span class="html">td</span> <span class="attr">class</span><span class="kwrd">="wrng"</span> <span class="attr">id</span><span class="kwrd">="tdLoginMessage"</span><span class="kwrd">></span>@@INSERT_USER_TEXT<span class="kwrd"></</span><span class="html">td</span><span class="kwrd">></span></pre>
<br />
Now in the page load if the tdLoginMessage contains the failure message redirect to an application page with the user name supplied in the page query string , AND YOU WILL BE BACK TO HE SHAREPOINT WORLD FINALLY :)<br />
<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt">function window_onload() {</pre>
<pre> onld();</pre>
<pre class="alt"> <span class="kwrd">if</span>(gbid(<span class="str">"tdLoginMessage"</span>).innerText.indexOf(<span class="str">"عذّر تسجيل دخولك إلى النظام. تأكد من صحة اسم المجال، واسم المستخدم، وكلمة المرور، ثم حاول من جديد"</span>) != -1){</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">var</span> userName = getCookie(<span class="str">"UserName"</span>);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span>( userName != <span class="str">""</span>){</pre>
<pre> window.location = <span class="str">"http://yoursever.local/_layout/Public/ValidateLoginFailure.aspx?UserName="</span> + userName;</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (chkCookies()) {</pre>
<pre class="alt"> ldCookie(<span class="str">'username'</span>, <span class="str">'password'</span>);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">var</span> expl1 = document.getElementById(<span class="str">'expl1'</span>);</pre>
<pre> expl1.style.display = <span class="str">""</span>;</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">var</span> lnkHidedSection = document.getElementById(<span class="str">'lnkHdSec'</span>);</pre>
<pre class="alt"> lnkHidedSection.style.display = <span class="str">"none"</span>;</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">var</span> lnkShowSection = document.getElementById(<span class="str">'lnkShwSec'</span>);</pre>
<pre> lnkShowSection.style.display = <span class="str">""</span>;</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> }</pre>
</div>
In my case my message was in this arabic format and the application page created was ValidateLoginFailure.aspx<br />
<br />
<b>-Find out why the user was not able to login</b><br />
Back to happy land, Now we will create an application page with the following properties:<br />
-Map your page to a public folder where you have the anonymous rule on ISA enabled for this path as this page will be accessible by anonymous user - The guy faild to login he is still anonymous :) - <br />
-Override the AllowAnonymousAccess property to return true to be able to be viewable by anonymous users<br />
<br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">bool</span> AllowAnonymousAccess</pre>
<pre>{</pre>
<pre class="alt"> <span class="kwrd">get</span></pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">return</span> <span class="kwrd">true</span>;</pre>
<pre> }</pre>
<pre class="alt">}</pre>
Add the following to youe web.config to enable the page for anonymous</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"> <span class="kwrd"><</span><span class="html">location</span> <span class="attr">path</span><span class="kwrd">="_layouts/Public/ValidateLoginFailure.aspx"</span><span class="kwrd">></span></pre>
<pre> <span class="kwrd"><</span><span class="html">system.web</span><span class="kwrd">></span></pre>
<pre class="alt"> <span class="kwrd"><</span><span class="html">identity</span> <span class="attr">impersonate</span><span class="kwrd">="true"</span> <span class="kwrd">/></span></pre>
<pre> <span class="kwrd"><</span><span class="html">authorization</span><span class="kwrd">></span></pre>
<pre class="alt"> <span class="kwrd"><</span><span class="html">allow</span> <span class="attr">users</span><span class="kwrd">="?"</span> <span class="kwrd">/></span></pre>
<pre> <span class="kwrd"></</span><span class="html">authorization</span><span class="kwrd">></span></pre>
<pre class="alt"> <span class="kwrd"></</span><span class="html">system.web</span><span class="kwrd">></span></pre>
<pre> <span class="kwrd"></</span><span class="html">location</span><span class="kwrd">></span></pre>
Ok, in the page load we will get the user name and using the LDAP query we will get the login failure.<br />
<br />
Now you should be redirected from the TMG login page with a URL looking like : http://yoursever.local/_layout/Public/ValidateLoginFailure.aspx?UserName=Domain\LoginName<br />
<br />
We will get the DirectoryEntry object for this user to be able to get the set of properties needed to know the failure cause by the following code:<br />
<ol style="text-align: left;">
<li>First check the Lock Out Time property for the user if it is not "0" so the account is locked</li>
<li>Second check the password last set property if it is "0" so the password was not ever set by the user</li>
<li>Check the max password age property vs. the password last set
property, if the time span between them both is less than zero then the
password has expire </li>
<li>Else check the user account control property to get the current status of the account .</li>
</ol>
</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Load(<span class="kwrd">object</span> sender, EventArgs e)</pre>
<pre>{</pre>
<pre class="alt"> <span class="kwrd">try</span></pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">if</span> (Page.Request != <span class="kwrd">null</span>)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">if</span> (Page.Request.QueryString[<span class="str">"UserName"</span>] != <span class="kwrd">null</span>)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">string</span> UserName = Page.Request.QueryString[<span class="str">"UserName"</span>].ToString();</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (HttpContext.Current.Session != <span class="kwrd">null</span>)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">uint</span> LCID = (<span class="kwrd">uint</span>)HttpContext.Current.Session.LCID;</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">string</span> StatusValue = String.Empty;</pre>
<pre> </pre>
<pre class="alt"> DirectoryEntry entry = <span class="kwrd">null</span>;</pre>
<pre> <span class="kwrd">using</span> (HostingEnvironment.Impersonate())</pre>
<pre class="alt"> {</pre>
<pre> entry = <span class="kwrd">new</span> DirectoryEntry(<span class="str">"LDAP://MyDomain/CN="</span> + UserName +<span class="str">",DC=MyDomain,DC=local"</span>);</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (entry != <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">long</span> pwdLastSet = 2;</pre>
<pre class="alt"> <span class="kwrd">long</span> ldate = 0;</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (entry.Properties[<span class="str">"pwdLastSet"</span>].Value != <span class="kwrd">null</span>)</pre>
<pre> {</pre>
<pre class="alt"> pwdLastSet = LongFromLargeIntegerObject(entry.Properties[<span class="str">"pwdLastSet"</span>].Value);</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (entry.Properties[<span class="str">"LockOutTime"</span>].Value != <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> ldate = LongFromLargeIntegerObject(entry.Properties[<span class="str">"LockOutTime"</span>].Value);</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">double</span>? TimeRemainingUntilPasswordExpiration = GetTimeRemainingUntilPasswordExpiration(entry);</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">//Account Locked</span></pre>
<pre> <span class="kwrd">if</span> (ldate != 0)</pre>
<pre class="alt"> {</pre>
<pre> StatusValue = GetLocalizedString(<span class="str">"Status_LockedAccount"</span>, LCID) + DateTime.FromFileTime(ldate).ToString(<span class="str">"dd/MM/yyyy"</span>);</pre>
<pre class="alt"> }</pre>
<pre> <span class="rem">//Account Password Expired</span></pre>
<pre class="alt"> <span class="kwrd">else</span> <span class="kwrd">if</span> (pwdLastSet == 0)</pre>
<pre> {</pre>
<pre class="alt"> StatusValue = GetLocalizedString(<span class="str">"Status_PasswordExpired"</span>, LCID);</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span> <span class="kwrd">if</span> (TimeRemainingUntilPasswordExpiration != <span class="kwrd">null</span> && TimeRemainingUntilPasswordExpiration < 0)</pre>
<pre> {</pre>
<pre class="alt"> StatusValue = GetLocalizedString(<span class="str">"Status_PasswordExpired"</span>, LCID);</pre>
<pre> }</pre>
<pre class="alt"> <span class="rem">//Account Expired</span></pre>
<pre> <span class="kwrd">else</span> <span class="kwrd">if</span> (entry.ExpirationDate > <span class="kwrd">new</span> DateTime(2000, 1, 1, 2, 0, 0) && entry.ExpirationDate <= DateTime.Now)</pre>
<pre class="alt"> {</pre>
<pre> StatusValue = GetLocalizedString(<span class="str">"Status_AccountExpired"</span>, LCID);</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> StatusValue = GetStatusValue(LCID, StatusValue, entry);</pre>
<pre> </pre>
<pre class="alt"> SendNotificationMail(entry, LCID, StatusValue);</pre>
<pre> <span class="rem">//lblStatus.Text = StatusValue;</span></pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> {</pre>
<pre> lblStatus.Text = <span class="str">"Could not Query AD LDAP Operation , Entity object is NULL"</span>;</pre>
<pre class="alt"> }</pre>
<pre> } </pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> {</pre>
<pre> Response.Write(<span class="str">"<!-- session null -->"</span>);</pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> {</pre>
<pre class="alt"> lblStatus.Text = <span class="str">"No Query String supplied"</span>;</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> {</pre>
<pre> lblStatus.Text = <span class="str">"Request rejected"</span>;</pre>
<pre class="alt"> </pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">catch</span> (Exception ex)</pre>
<pre class="alt"> {</pre>
<pre> lblStatus.Text = ex.Message + <span class="str">" "</span> + ex.StackTrace;</pre>
<pre class="alt"> }</pre>
<pre>}</pre>
Following are the helper methods used in the page load method :<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">double</span>? GetTimeRemainingUntilPasswordExpiration(DirectoryEntry entry)</pre>
<pre>{</pre>
<pre class="alt"> <span class="kwrd">if</span> (entry.Properties.Contains(<span class="str">"maxPwdAge"</span>))</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">long</span> pwdLastSet = LongFromLargeIntegerObject(entry.Properties[<span class="str">"pwdLastSet"</span>].Value);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (entry.Properties[<span class="str">"maxPwdAge"</span>].Value != <span class="kwrd">null</span> && pwdLastSet != 0)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">var</span> maxPasswordAge = <span class="kwrd">int</span>.Parse(entry.Properties[<span class="str">"maxPwdAge"</span>].Value.ToString());</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">return</span> maxPasswordAge - (DateTime.Now - DateTime.FromFileTime(pwdLastSet)).TotalDays;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> <span class="kwrd">return</span> <span class="kwrd">null</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> <span class="kwrd">return</span> <span class="kwrd">null</span>;</pre>
<pre>}</pre>
<pre class="alt"> </pre>
<pre><span class="rem">/// <summary></span></pre>
<pre class="alt"><span class="rem">/// Used for the date time of the locked out account</span></pre>
<pre><span class="rem">/// </summary></span></pre>
<pre class="alt"><span class="rem">/// <param name="largeInteger"></param></span></pre>
<pre><span class="rem">/// <returns></returns></span></pre>
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">long</span> LongFromLargeIntegerObject(<span class="kwrd">object</span> largeInteger)</pre>
<pre>{</pre>
<pre class="alt"> System.Type type = largeInteger.GetType();</pre>
<pre> <span class="kwrd">int</span> highPart = (<span class="kwrd">int</span>)type.InvokeMember(<span class="str">"HighPart"</span>, BindingFlags.GetProperty, <span class="kwrd">null</span>,</pre>
<pre class="alt"> largeInteger, <span class="kwrd">null</span>);</pre>
<pre> <span class="kwrd">int</span> lowPart = (<span class="kwrd">int</span>)type.InvokeMember(<span class="str">"LowPart"</span>, BindingFlags.GetProperty, <span class="kwrd">null</span>, largeInteger, <span class="kwrd">null</span>);</pre>
<pre class="alt"> <span class="kwrd">return</span> (<span class="kwrd">long</span>)highPart << 32 | (<span class="kwrd">uint</span>)lowPart;</pre>
<pre>} </pre>
</div>
Now if all those cases are not met we need to check the user account control property to get the current status of the account .<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GetStatusValue(<span class="kwrd">uint</span> LCID, <span class="kwrd">string</span> StatusValue, DirectoryEntry entry)</pre>
<pre>{</pre>
<pre class="alt"> <span class="kwrd">string</span> AccountControlValue = entry.Properties[<span class="str">"userAccountControl"</span>].Value.ToString();</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">switch</span> (AccountControlValue)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"512"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledAccount"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"514"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledAccount"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"544"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledPasswordNotRequired"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"546"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledPasswordNotRequired"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"66048"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledPasswordDoesnotExpire"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"66050"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledPasswordDoesnotExpire"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"66080"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledPasswordDoesnotExpireNotRequired"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"66082"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledPasswordDoesnotExpireNotRequired"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"262656"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledSmartcardRequired"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"262658"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledSmartcardRequired"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"262688"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledSmartcardRequiredPasswordNotRequired"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"262690"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledSmartcardRequiredPasswordNotRequired"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"328192"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledSmartcardRequiredPasswordDoesnotExpire"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"328194"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledSmartcardRequiredPasswordDoesnotExpire"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">case</span> <span class="str">"328224"</span>:</pre>
<pre> StatusValue = <span class="str">"Status_EnabledSmartcardRequiredPasswordDoesnotExpireNotRequired"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> <span class="kwrd">case</span> <span class="str">"328226"</span>:</pre>
<pre class="alt"> StatusValue = <span class="str">"Status_DisabledSmartcardRequiredPasswordDoesnotExpireNotRequired"</span>;</pre>
<pre> <span class="kwrd">break</span>;</pre>
<pre class="alt"> <span class="kwrd">default</span>:</pre>
<pre> StatusValue = <span class="str">"Status_NotAvailable"</span>;</pre>
<pre class="alt"> <span class="kwrd">break</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">return</span> StatusValue ;</pre>
<pre>}</pre>
<pre> </pre>
<pre> </pre>
</div>
Hope you find this post useful :)</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-44595115326866231302013-01-30T16:59:00.000+02:002013-02-05T13:11:27.556+02:00Creating external system (BCS) Search content sources and binding carwled properties to metadata properties programmatically<div dir="ltr" style="text-align: left;" trbidi="on">
Business Connectivity Services (BCS) is a set of services and features that
connect SharePoint-based solutions to sources of external data. It is
included in SharePoint Foundation 2010, SharePoint Server 2010, and
Office 2010 applications.<br />
<br />
Search Service Application (SSA) Allows for the content to be crawled, indexed, and then allows for users to get results through search queries.<br />
<br />
Ok, what about combing those two nice features together , The power of BCS to get data from external data sources and the power of SSA to crawl this data, index it and query it in just no time.<br />
<br />
Searching you content using SSA can be configured from the central admin like a piece of cake , according to those articles MSDN articles <a href="http://msdn.microsoft.com/en-us/library/gg512148%28v=office.14%29.aspx" target="_blank">Part 1</a> & <a href="http://msdn.microsoft.com/en-us/library/gg512147%28v=office.14%29.aspx" target="_blank">Part 2</a>, and <a href="http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010general.aspx?ID=c052a46a-fad7-4205-8f66-503ed46c072d" target="_blank">this nice article</a> <br />
<br />
In this article I assume that you have gone among all these hassle before, But what about creating this whole structure in just one click, on feature activation for example.<br />
<br />
What about a site scope feature that would create a Business search content source , then creates a search scope associated to this content source ,Perform a full crawl to get the crawled external fields then connect those fields to a managed properties to be easy for advanced search query.<br />
<br />
Ok lets start.<br />
<br />
I am assume that you have created an external content type with LOB system named "LOBSystemName" and LOB system instance named "LOBSystemInstanceName"<br />
<br />
to create the business content source you need to do the following <br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">using</span> (SPSite site = <span class="kwrd">new</span> SPSite(SiteURL))</pre>
<pre><span class="lnum"> 2: </span> {</pre>
<pre class="alt"><span class="lnum"> 3: </span> SearchContext context = SearchContext.GetContext(site);</pre>
<pre><span class="lnum"> 4: </span> </pre>
<pre class="alt"><span class="lnum"> 5: </span> Content BSCContent = <span class="kwrd">new</span> Content(context);</pre>
<pre><span class="lnum"> 6: </span> </pre>
<pre class="alt"><span class="lnum"> 7: </span> ContentSourceCollection BSCContentSourceCollection = BSCContent.ContentSources;</pre>
<pre><span class="lnum"> 8: </span> <span class="kwrd">string</span> NewContentSource = "New Content Source Title";</pre>
<pre class="alt"><span class="lnum"> 9: </span> </pre>
<pre><span class="lnum"> 10: </span> <span class="kwrd">if</span> (BSCContentSourceCollection.Exists(NewContentSource))</pre>
<pre class="alt"><span class="lnum"> 11: </span> {</pre>
<pre><span class="lnum"> 12: </span> Console.WriteLine(<span class="str">"Content Source Already Exsist"</span>);</pre>
<pre class="alt"><span class="lnum"> 13: </span> </pre>
<pre><span class="lnum"> 14: </span> <span class="kwrd">return</span> <span class="kwrd">false</span>;</pre>
<pre class="alt"><span class="lnum"> 15: </span> }</pre>
<pre><span class="lnum"> 16: </span> <span class="kwrd">else</span></pre>
<pre class="alt"><span class="lnum"> 17: </span> {</pre>
<pre><span class="lnum"> 18: </span> <span class="kwrd">try</span></pre>
<pre class="alt"><span class="lnum"> 19: </span> {</pre>
<pre><span class="lnum"> 20: </span> BusinessDataContentSource BSCContentSource = (BusinessDataContentSource)BSCContentSourceCollection.Create(<span class="kwrd">typeof</span>(BusinessDataContentSource), NewContentSource);</pre>
<pre class="alt"><span class="lnum"> 21: </span> </pre>
<pre><span class="lnum"> 22: </span> BSCContentSource.StartAddresses.Add(BusinessDataContentSource.ConstructStartAddress(<span class="str">"Default"</span>, <span class="kwrd">new</span> Guid(<span class="str">"00000000-0000-0000-0000-000000000000"</span>), "LOBSystemName", "LOBSystemInstanceName"));</pre>
<pre class="alt"><span class="lnum"> 23: </span> </pre>
<pre><span class="lnum"> 24: </span> BSCContentSource.StartFullCrawl();</pre>
<pre class="alt"><span class="lnum"> 25: </span> </pre>
<pre><span class="lnum"> 26: </span> <span class="kwrd">return</span> <span class="kwrd">true</span>;</pre>
<pre class="alt"><span class="lnum"> 27: </span> }</pre>
<pre><span class="lnum"> 28: </span> <span class="kwrd">catch</span> (Exception ex)</pre>
<pre class="alt"><span class="lnum"> 29: </span> {</pre>
<pre><span class="lnum"> 30: </span> Console.WriteLine(<span class="str">"Faild to ceate content source"</span>);</pre>
<pre class="alt"><span class="lnum"> 31: </span> Console.WriteLine(ex.Message);</pre>
<pre><span class="lnum"> 32: </span> </pre>
<pre class="alt"><span class="lnum"> 33: </span> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(<span class="str">"Faild to ceate content source \n"</span> + ex.Message);</pre>
<pre><span class="lnum"> 34: </span> }</pre>
<pre class="alt"><span class="lnum"> 35: </span> }</pre>
<pre><span class="lnum"> 36: </span> </pre>
<pre class="alt"><span class="lnum"> 37: </span> }</pre>
<br />
Now the content source is created you will need to create a search scope to be associated with the newly created content source the following method will do this task :<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="rem">/// <summary></span></pre>
<pre> <span class="rem">/// Create new Content Source type Search Scope</span></pre>
<pre class="alt"> <span class="rem">/// </summary></span></pre>
<pre> <span class="rem">/// <param name="site">The new created site </param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="context">The Search context to create the Search Scope within</param></span></pre>
<pre> <span class="rem">/// <param name="ContentSourceName">The Search content source name to be associated to the new Search Scope</param></span></pre>
<pre class="alt"> <span class="kwrd">static</span> <span class="kwrd">private</span> <span class="kwrd">void</span> CreateBCSSearchScope(SPSite site,SearchContext context, <span class="kwrd">string</span> ContentSourceName )</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">string</span> scopeName = ContentSourceName ;</pre>
<pre> <span class="kwrd">string</span> displayGroupName = <span class="str">"GTS Scopes"</span>;</pre>
<pre class="alt"> <span class="rem">// remotescopes class retrieves information via search web service so we run this as the search service account</span></pre>
<pre> </pre>
<pre class="alt"> RemoteScopes remoteScopes = <span class="kwrd">new</span> RemoteScopes(SPServiceContext.GetContext(site));</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// see if there is an existing scope</span></pre>
<pre> </pre>
<pre class="alt"> Scope scope = (<span class="kwrd">from</span> s</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">in</span> remoteScopes.GetScopesForSite(<span class="kwrd">new</span> Uri(site.Url)).Cast<Scope>()</pre>
<pre> </pre>
<pre class="alt"> where s.Name == scopeName</pre>
<pre> </pre>
<pre class="alt"> select s).FirstOrDefault();</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// only add if the scope doesn't exist already</span></pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (scope == <span class="kwrd">null</span>)</pre>
<pre> {</pre>
<pre class="alt"> Schema sspSchema = <span class="kwrd">new</span> Schema(context);</pre>
<pre> ManagedPropertyCollection properties = sspSchema.AllManagedProperties;</pre>
<pre class="alt"> scope = remoteScopes.AllScopes.Create(scopeName, <span class="str">"Search Scope for "</span> + scopeName, <span class="kwrd">null</span>, <span class="kwrd">true</span>, <span class="str">"results.aspx"</span>, ScopeCompilationType.AlwaysCompile);</pre>
<pre> scope.Rules.CreatePropertyQueryRule(ScopeRuleFilterBehavior.Include, properties[<span class="str">"ContentSource"</span>], ContentSourceName);</pre>
<pre class="alt"> </pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// see if there is an existing display group </span></pre>
<pre class="alt"> </pre>
<pre> ScopeDisplayGroup displayGroup = (<span class="kwrd">from</span> d</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">in</span> remoteScopes.GetDisplayGroupsForSite(<span class="kwrd">new</span> Uri(site.Url)).Cast<ScopeDisplayGroup>()</pre>
<pre class="alt"> </pre>
<pre> where d.Name == displayGroupName</pre>
<pre class="alt"> </pre>
<pre> select d).FirstOrDefault();</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// add if the display group doesn't exist</span></pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (displayGroup == <span class="kwrd">null</span>)</pre>
<pre class="alt"> </pre>
<pre> displayGroup = remoteScopes.AllDisplayGroups.Create(displayGroupName, <span class="str">""</span>, <span class="kwrd">new</span> Uri(site.Url), <span class="kwrd">true</span>);</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// add scope to display group if not already added</span></pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!displayGroup.Contains(scope))</pre>
<pre class="alt"> {</pre>
<pre> </pre>
<pre class="alt"> displayGroup.Add(scope);</pre>
<pre> </pre>
<pre class="alt"> displayGroup.Default = scope;</pre>
<pre> </pre>
<pre class="alt"> displayGroup.Update();</pre>
<pre> </pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// optionally force a scope compilation so this is available immediately</span></pre>
<pre> </pre>
<pre class="alt"> remoteScopes.StartCompilation();</pre>
<pre> }</pre>
</div>
The site is the current site you are creating this whole topology for and the Search context is already defined in the previous method<br />
<br />
OK, Recap , Content Source Created DONE , Search Scope created and associated DONE, Now we need to perform a full crawl to get Crawled properties "Database table fields in our case" to be able to map those properties to a managed metadata properties.<br />
<br />
to do this step we need to make a while loop to just start the crawl and waits till its done then call the create managed property method... the following code snippet is the key :<br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"> BSCContentSource.StartFullCrawl();</pre>
<pre> </pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Carwling wil start in 10 secounds"</span>);</pre>
<pre class="alt"> Thread.Sleep(10 * 1000);</pre>
<pre> Console.WriteLine(<span class="str">"Carwling Started"</span>);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">do</span></pre>
<pre> {</pre>
<pre class="alt"> Thread.Sleep(10 * 1000);</pre>
<pre> Console.WriteLine(<span class="str">"Waiting the content source to finish crawling.."</span>);</pre>
<pre> } while (BSCContentSource.CrawlStatus != CrawlStatus.Idle);</pre>
<pre class="alt"> </pre>
<pre> Console.WriteLine(<span class="str">"Crawling has been done successfully !"</span>);</pre>
<pre class="alt"> PMFLogger.Instance.LogInformation(<span class="str">"Crawling has been done successfully !"</span>);</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">//Start creating/mapping the new Metadata Properties</span></pre>
<pre> CreateBCSMetadataProperties(context, ModelName);</pre>
Now the data is crawled, indexed ....ok lets create the managed properties and map the crawled fields to those properties , In my case i had the following Columns in the SQL database -External data source -<br />
<br />
ID, Title, StartDate, EndDate, Entity, Type, OrganizationUnit, Owner, Alias and StrategyPlan.<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"> <span class="rem">/// <summary></span></pre>
<pre> <span class="rem">/// Creates new Business Search Metadata Properties to be used in the search</span></pre>
<pre class="alt"> <span class="rem">/// </summary></span></pre>
<pre> <span class="rem">/// <param name="context">The Search context to create the Business Search Metadata Properties within</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="ModelName">The newly created BCS Model name to aquire and map columns from</param></span></pre>
<pre> <span class="kwrd">static</span> <span class="kwrd">private</span> <span class="kwrd">void</span> CreateBCSMetadataProperties(SearchContext context,<span class="kwrd">string</span> ModelName)</pre>
<pre class="alt"> {</pre>
<pre> Schema sspSchema = <span class="kwrd">new</span> Schema(context);</pre>
<pre class="alt"> ManagedPropertyCollection properties = sspSchema.AllManagedProperties;</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">//Create the content properties if they does not exist else get the already created ones for the mappings</span></pre>
<pre> ManagedProperty ectID;</pre>
<pre class="alt"> ManagedProperty ectTitle;</pre>
<pre> ManagedProperty ectStartDate;</pre>
<pre class="alt"> ManagedProperty ectEndDate;</pre>
<pre> ManagedProperty ectEntity;</pre>
<pre class="alt"> ManagedProperty ectType;</pre>
<pre> ManagedProperty ectOrganizationUnit;</pre>
<pre class="alt"> ManagedProperty ectOwner;</pre>
<pre> ManagedProperty ectAlias;</pre>
<pre class="alt"> ManagedProperty ectStrategyPlan;</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectID"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectID = properties.Create(<span class="str">"ectID"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectID.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectID = properties[<span class="str">"ectID"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectTitle"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectTitle = properties.Create(<span class="str">"ectTitle"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectTitle.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectTitle = properties[<span class="str">"ectTitle"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectStartDate"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectStartDate = properties.Create(<span class="str">"ectStartDate"</span>, ManagedDataType.DateTime);</pre>
<pre class="alt"> ectStartDate.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectStartDate.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectStartDate = properties[<span class="str">"ectStartDate"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectEndDate"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectEndDate = properties.Create(<span class="str">"ectEndDate"</span>, ManagedDataType.DateTime);</pre>
<pre> ectEndDate.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectEndDate.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectEndDate = properties[<span class="str">"ectEndDate"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectEntity"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectEntity = properties.Create(<span class="str">"ectEntity"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectEntity.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectEntity.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectEntity = properties[<span class="str">"ectEntity"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectType"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectType = properties.Create(<span class="str">"ectType"</span>, ManagedDataType.Text);</pre>
<pre> ectType.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectType.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectType = properties[<span class="str">"ectType"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectOrganizationUnit"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectOrganizationUnit = properties.Create(<span class="str">"ectOrganizationUnit"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectOrganizationUnit.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectOrganizationUnit.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectOrganizationUnit = properties[<span class="str">"ectOrganizationUnit"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectOwner"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectOwner = properties.Create(<span class="str">"ectOwner"</span>, ManagedDataType.Text);</pre>
<pre> ectOwner.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectOwner.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectOwner = properties[<span class="str">"ectOwner"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectAlias"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectAlias = properties.Create(<span class="str">"ectAlias"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectAlias.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectAlias.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> ectAlias.MaxCharactersInPropertyStoreIndex = 450;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectAlias = properties[<span class="str">"ectAlias"</span>];</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectStrategyPlan"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectStrategyPlan = properties.Create(<span class="str">"ectStrategyPlan"</span>, ManagedDataType.Text);</pre>
<pre> ectStrategyPlan.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectStrategyPlan.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectStrategyPlan = properties[<span class="str">"ectStrategyPlan"</span>];</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">//Map the Query Crawled Properties to the Managed Property</span></pre>
<pre> MaptoManagedProperty(context, ectID, ModelName + <span class="str">" Items.ID"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectTitle, ModelName + <span class="str">" Items.Name"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectStartDate, ModelName + <span class="str">" Items.StartDate"</span>, ManagedDataType.DateTime);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectEndDate, ModelName + <span class="str">" Items.EndDate"</span>, ManagedDataType.DateTime);</pre>
<pre> MaptoManagedProperty(context, ectEntity, ModelName + <span class="str">" Items.Entity"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectType, ModelName + <span class="str">" Items.Type"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectOrganizationUnit, ModelName + <span class="str">" Items.OrganizationUnit"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectOwner, ModelName + <span class="str">" Items.Owner"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectAlias, ModelName + <span class="str">" Items.Alias"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectStrategyPlan, ModelName + <span class="str">" Items.StrategyPlan"</span>, ManagedDataType.Text);</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">/// <summary></span></pre>
<pre class="alt"> <span class="rem">/// Maps the external content type columns to a specific Managed Property</span></pre>
<pre> <span class="rem">/// </summary></span></pre>
<pre class="alt"> <span class="rem">/// <param name="context">The Search context to map the the external content type columns within</param></span></pre>
<pre> <span class="rem">/// <param name="managedProperty">The managed property to map the column to</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="crawledPropertyName">The crawled property "Column" Name</param></span></pre>
<pre> <span class="rem">/// <param name="DataType"></param></span></pre>
<pre class="alt"> <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> MaptoManagedProperty(SearchContext context, ManagedProperty managedProperty, <span class="kwrd">string</span> crawledPropertyName, ManagedDataType DataType)</pre>
<pre> {</pre>
<pre class="alt"> SPSecurity.RunWithElevatedPrivileges(() =></pre>
<pre> {</pre>
<pre class="alt"> Schema schema = <span class="kwrd">new</span> Schema(context);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">try</span></pre>
<pre> {</pre>
<pre class="alt"> Category category = schema.AllCategories[<span class="str">"Business Data"</span>];</pre>
<pre> <span class="kwrd">var</span> crawledProps = category.QueryCrawledProperties(crawledPropertyName, 1, Guid.NewGuid(), String.Empty, <span class="kwrd">true</span>).Cast<CrawledProperty>();</pre>
<pre class="alt"> <span class="kwrd">var</span> crawledProp = crawledProps.FirstOrDefault();</pre>
<pre> <span class="kwrd">if</span> (crawledProp != <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">var</span> mappings = managedProperty.GetMappings();</pre>
<pre class="alt"> mappings.Add(<span class="kwrd">new</span> Mapping(crawledProp.Propset, crawledProp.Name, crawledProp.VariantType, managedProperty.PID));</pre>
<pre> managedProperty.SetMappings(mappings);</pre>
<pre class="alt"> managedProperty.Update();</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> {</pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Query Crawled Property "</span> + crawledPropertyName + <span class="str">" was not found - Mapping faild."</span>);</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">catch</span> (Exception ex)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(<span class="str">"Faild to map field to Crawled Property \n"</span> + ex.Message);</pre>
<pre class="alt"> }</pre>
<pre> });</pre>
<pre class="alt"> </pre>
<pre> }</pre>
Ok you will find some objects that needs to be described:<br />
The "ModelName" object is the External content type model name<br />
<br />
Why is "EnabledForScoping" set to true .... that is easy to able the new Managed properties to be exposed to search scopes<br />
<br />
Why is some properties "HasMultipleValues" set to false ..... ok if your Managed property is a datetime or int the return data in the search result will be <span class="st"><i>System.DateTime</i>[] not the actual crawled value by setting this property to false issue solved :)</span><br />
<span class="st"><br /></span>
<span class="st">Why is "MaxCharactersInPropertyStoreIndex" set to 450 , this </span>to Reduce storage requirements for text properties by using a hash for comparison, or simply to be able to order search results by this metadata property.<br />
<br />
The Whole code in one block .... Have a nice day :)<br />
<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="kwrd">using</span> System;</pre>
<pre><span class="kwrd">using</span> System.Collections.Generic;</pre>
<pre class="alt"><span class="kwrd">using</span> System.Linq;</pre>
<pre><span class="kwrd">using</span> System.Text;</pre>
<pre class="alt"> </pre>
<pre><span class="kwrd">using</span> Microsoft.SharePoint;</pre>
<pre class="alt"><span class="kwrd">using</span> Microsoft.SharePoint.Client;</pre>
<pre><span class="kwrd">using</span> Microsoft.SharePoint.Administration;</pre>
<pre class="alt"><span class="kwrd">using</span> Microsoft.Office.Server;</pre>
<pre><span class="kwrd">using</span> Microsoft.Office.Server.Search.Administration;</pre>
<pre class="alt"><span class="kwrd">using</span> System.Threading;</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre><span class="kwrd">namespace</span> BCSModelGeneration</pre>
<pre class="alt">{ </pre>
<pre> <span class="kwrd">public</span> <span class="kwrd">class</span> ContentSourceGenerator</pre>
<pre class="alt"> {</pre>
<pre> <span class="rem">/// <summary></span></pre>
<pre class="alt"> <span class="rem">/// Create Bussiness Connectivity Service LOB SharePoint Content Source</span></pre>
<pre> <span class="rem">/// </summary></span></pre>
<pre class="alt"> <span class="rem">/// <param name="InitialCatalog">Rdb Connection tenant Initial Catalog</param></span></pre>
<pre> <span class="rem">/// <param name="SiteURL">The new created site - Entity</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="ModelName">The new created Model Name </param></span></pre>
<pre> <span class="rem">/// <returns>The status of the LOB SharePoint Content Source creation</returns></span></pre>
<pre class="alt"> <span class="kwrd">internal</span> <span class="kwrd">static</span> <span class="kwrd">bool</span> CreateBCSContentSource(<span class="kwrd">string</span> InitialCatalog, <span class="kwrd">string</span> SiteURL, <span class="kwrd">string</span> ModelName)</pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">using</span> (SPSite site = <span class="kwrd">new</span> SPSite(SiteURL))</pre>
<pre> {</pre>
<pre class="alt"> SearchContext context = SearchContext.GetContext(site);</pre>
<pre> </pre>
<pre class="alt"> Content BSCContent = <span class="kwrd">new</span> Content(context);</pre>
<pre> </pre>
<pre class="alt"> ContentSourceCollection BSCContentSourceCollection = BSCContent.ContentSources;</pre>
<pre> <span class="kwrd">string</span> NewContentSource = InitialCatalog;</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (BSCContentSourceCollection.Exists(NewContentSource))</pre>
<pre class="alt"> {</pre>
<pre> Console.WriteLine(<span class="str">"Content Source Already Exsist"</span>);</pre>
<pre class="alt"> <span class="kwrd">return</span> <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> {</pre>
<pre class="alt"> <span class="kwrd">try</span></pre>
<pre> {</pre>
<pre class="alt"> BusinessDataContentSource BSCContentSource = (BusinessDataContentSource)BSCContentSourceCollection.Create(<span class="kwrd">typeof</span>(BusinessDataContentSource), NewContentSource);</pre>
<pre> </pre>
<pre class="alt"> BSCContentSource.StartAddresses.Add(BusinessDataContentSource.ConstructStartAddress(<span class="str">"Default"</span>, <span class="kwrd">new</span> Guid(<span class="str">"00000000-0000-0000-0000-000000000000"</span>), InitialCatalog, InitialCatalog));</pre>
<pre> </pre>
<pre class="alt"> WeeklySchedule Weekly = CreatWeeklySchedule(context, 2);</pre>
<pre> </pre>
<pre class="alt"> BSCContentSource.FullCrawlSchedule = Weekly;</pre>
<pre> </pre>
<pre class="alt"> DailySchedule Daily = CreateDailySchedule(context, 2);</pre>
<pre> BSCContentSource.IncrementalCrawlSchedule = Daily;</pre>
<pre class="alt"> </pre>
<pre> BSCContentSource.Update();</pre>
<pre class="alt"> </pre>
<pre> BSCContentSource.StartFullCrawl();</pre>
<pre class="alt"> </pre>
<pre> Console.WriteLine(<span class="str">"Carwling wil start in 10 secounds"</span>);</pre>
<pre class="alt"> Thread.Sleep(10 * 1000);</pre>
<pre> Console.WriteLine(<span class="str">"Carwling Started"</span>);</pre>
<pre class="alt"> <span class="rem">//Start creating the new Search Scope</span></pre>
<pre> CreateBCSSearchScope(site, context, BSCContentSource.Name);</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">do</span></pre>
<pre class="alt"> {</pre>
<pre> Thread.Sleep(10 * 1000);</pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Waiting the content source to finish crawling.."</span>);</pre>
<pre> } while (BSCContentSource.CrawlStatus != CrawlStatus.Idle);</pre>
<pre class="alt"> </pre>
<pre> Console.WriteLine(<span class="str">"Crawling has been done successfully !"</span>);</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">//Start creating/mapping the new Metadata Properties</span></pre>
<pre class="alt"> CreateBCSMetadataProperties(context, ModelName);</pre>
<pre> </pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Content Source Created"</span>);</pre>
<pre> </pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Starting a new Crawling process to the content source to fill the new mapped Metadata Properties"</span>);</pre>
<pre> </pre>
<pre class="alt"> BSCContentSource.StartFullCrawl();</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">return</span> <span class="kwrd">true</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">catch</span> (Exception ex)</pre>
<pre> {</pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Faild to ceate content source"</span>);</pre>
<pre> Console.WriteLine(ex.Message);</pre>
<pre class="alt"> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(<span class="str">"Faild to ceate content source \n"</span> + ex.Message);</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> }</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">/// <summary></span></pre>
<pre class="alt"> <span class="rem">/// Creats a Weekly Schedule for the search content source</span></pre>
<pre> <span class="rem">/// </summary></span></pre>
<pre class="alt"> <span class="rem">/// <param name="context">The Search context to create the schedule within</param></span></pre>
<pre> <span class="rem">/// <param name="WeeksInterval">Indicates that the content should be crawled every "WeeksInterval" number of weeks</param></span></pre>
<pre class="alt"> <span class="rem">/// <returns></returns></span></pre>
<pre> <span class="kwrd">private</span> <span class="kwrd">static</span> WeeklySchedule CreatWeeklySchedule(SearchContext context,<span class="kwrd">int</span> WeeksInterval)</pre>
<pre class="alt"> {</pre>
<pre> WeeklySchedule Weekly = <span class="kwrd">new</span> WeeklySchedule(context);</pre>
<pre class="alt"> </pre>
<pre> Weekly.BeginDay = DateTime.Now.Day;</pre>
<pre class="alt"> Weekly.BeginMonth = DateTime.Now.Month;</pre>
<pre> Weekly.BeginYear = DateTime.Now.Year;</pre>
<pre class="alt"> <span class="rem">//Starts at 1:00 AM</span></pre>
<pre> Weekly.StartHour = 1;</pre>
<pre class="alt"> Weekly.StartMinute = 00;</pre>
<pre> <span class="rem">//Indicates that the content should be crawled every WeeksInterval weeks.</span></pre>
<pre class="alt"> Weekly.WeeksInterval = WeeksInterval;</pre>
<pre> <span class="kwrd">return</span> Weekly;</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">/// <summary></span></pre>
<pre> <span class="rem">/// Creats a Daily Schedule for the search content source</span></pre>
<pre class="alt"> <span class="rem">/// </summary></span></pre>
<pre> <span class="rem">/// <param name="context">The Search context to create the schedule within</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="DaysInterval">Indicates that the content should be crawled every "DaysInterval" number of days.</param></span></pre>
<pre> <span class="rem">/// <returns></returns></span></pre>
<pre class="alt"> <span class="kwrd">private</span> <span class="kwrd">static</span> DailySchedule CreateDailySchedule(SearchContext context,<span class="kwrd">int</span> DaysInterval)</pre>
<pre> {</pre>
<pre class="alt"> DailySchedule Daily = <span class="kwrd">new</span> DailySchedule(context);</pre>
<pre> Daily.BeginDay = DateTime.Now.Day;</pre>
<pre class="alt"> Daily.BeginMonth = DateTime.Now.Month;</pre>
<pre> Daily.BeginYear = DateTime.Now.Year;</pre>
<pre class="alt"> <span class="rem">//Starts at 1:00 AM</span></pre>
<pre> Daily.StartHour = 1;</pre>
<pre class="alt"> Daily.StartMinute = 00;</pre>
<pre> <span class="rem">//Indicates that the content should be crawled every DaysInterval days.</span></pre>
<pre class="alt"> Daily.DaysInterval = DaysInterval;</pre>
<pre> <span class="rem">//Adjusting the daily schedule to run every hour</span></pre>
<pre class="alt"> <span class="rem">//Hourly.RepeatInterval = 60;</span></pre>
<pre> <span class="rem">//Hourly.RepeatDuration = 1440;</span></pre>
<pre class="alt"> <span class="kwrd">return</span> Daily;</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">/// <summary></span></pre>
<pre class="alt"> <span class="rem">/// Create new Content Source type Search Scope</span></pre>
<pre> <span class="rem">/// </summary></span></pre>
<pre class="alt"> <span class="rem">/// <param name="site">The new created site - Entity</param></span></pre>
<pre> <span class="rem">/// <param name="context">The Search context to create the Search Scope within</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="ContentSourceName">The Search content source name to be associated to the new Search Scope</param></span></pre>
<pre> <span class="kwrd">static</span> <span class="kwrd">private</span> <span class="kwrd">void</span> CreateBCSSearchScope(SPSite site,SearchContext context, <span class="kwrd">string</span> ContentSourceName )</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">string</span> scopeName = ContentSourceName ;</pre>
<pre class="alt"> <span class="kwrd">string</span> displayGroupName = <span class="str">"GTS Scopes"</span>;</pre>
<pre> <span class="rem">// remotescopes class retrieves information via search web service so we run this as the search service account</span></pre>
<pre class="alt"> </pre>
<pre> RemoteScopes remoteScopes = <span class="kwrd">new</span> RemoteScopes(SPServiceContext.GetContext(site));</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// see if there is an existing scope</span></pre>
<pre class="alt"> </pre>
<pre> Scope scope = (<span class="kwrd">from</span> s</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">in</span> remoteScopes.GetScopesForSite(<span class="kwrd">new</span> Uri(site.Url)).Cast<Scope>()</pre>
<pre class="alt"> </pre>
<pre> where s.Name == scopeName</pre>
<pre class="alt"> </pre>
<pre> select s).FirstOrDefault();</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// only add if the scope doesn't exist already</span></pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (scope == <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> Schema sspSchema = <span class="kwrd">new</span> Schema(context);</pre>
<pre class="alt"> ManagedPropertyCollection properties = sspSchema.AllManagedProperties;</pre>
<pre> scope = remoteScopes.AllScopes.Create(scopeName, <span class="str">"Search Scope for "</span> + scopeName, <span class="kwrd">null</span>, <span class="kwrd">true</span>, <span class="str">"results.aspx"</span>, ScopeCompilationType.AlwaysCompile);</pre>
<pre class="alt"> scope.Rules.CreatePropertyQueryRule(ScopeRuleFilterBehavior.Include, properties[<span class="str">"ContentSource"</span>], ContentSourceName);</pre>
<pre> </pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// see if there is an existing display group </span></pre>
<pre> </pre>
<pre class="alt"> ScopeDisplayGroup displayGroup = (<span class="kwrd">from</span> d</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">in</span> remoteScopes.GetDisplayGroupsForSite(<span class="kwrd">new</span> Uri(site.Url)).Cast<ScopeDisplayGroup>()</pre>
<pre> </pre>
<pre class="alt"> where d.Name == displayGroupName</pre>
<pre> </pre>
<pre class="alt"> select d).FirstOrDefault();</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// add if the display group doesn't exist</span></pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (displayGroup == <span class="kwrd">null</span>)</pre>
<pre> </pre>
<pre class="alt"> displayGroup = remoteScopes.AllDisplayGroups.Create(displayGroupName, <span class="str">""</span>, <span class="kwrd">new</span> Uri(site.Url), <span class="kwrd">true</span>);</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="rem">// add scope to display group if not already added</span></pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!displayGroup.Contains(scope))</pre>
<pre> {</pre>
<pre class="alt"> </pre>
<pre> displayGroup.Add(scope);</pre>
<pre class="alt"> </pre>
<pre> displayGroup.Default = scope;</pre>
<pre class="alt"> </pre>
<pre> displayGroup.Update();</pre>
<pre class="alt"> </pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">// optionally force a scope compilation so this is available immediately</span></pre>
<pre class="alt"> </pre>
<pre> remoteScopes.StartCompilation();</pre>
<pre class="alt"> }</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">/// <summary></span></pre>
<pre> <span class="rem">/// Creates new Business Search Metadata Properties to be used in the search</span></pre>
<pre class="alt"> <span class="rem">/// </summary></span></pre>
<pre> <span class="rem">/// <param name="context">The Search context to create the Business Search Metadata Properties within</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="ModelName">The newly created BCS Model name to aquire and map columns from</param></span></pre>
<pre> <span class="kwrd">static</span> <span class="kwrd">private</span> <span class="kwrd">void</span> CreateBCSMetadataProperties(SearchContext context,<span class="kwrd">string</span> ModelName)</pre>
<pre class="alt"> {</pre>
<pre> Schema sspSchema = <span class="kwrd">new</span> Schema(context);</pre>
<pre class="alt"> ManagedPropertyCollection properties = sspSchema.AllManagedProperties;</pre>
<pre> </pre>
<pre class="alt"> <span class="rem">//TODO: ADD THE NEW FIELDS ADDED TO THE VIEW AFTER FINALIZATION</span></pre>
<pre> <span class="rem">//Create the content properties if they does not exist else get the already created ones for the mappings</span></pre>
<pre class="alt"> ManagedProperty ectID;</pre>
<pre> ManagedProperty ectTitle;</pre>
<pre class="alt"> ManagedProperty ectStartDate;</pre>
<pre> ManagedProperty ectEndDate;</pre>
<pre class="alt"> ManagedProperty ectEntity;</pre>
<pre> ManagedProperty ectType;</pre>
<pre class="alt"> ManagedProperty ectOrganizationUnit;</pre>
<pre> ManagedProperty ectOwner;</pre>
<pre class="alt"> ManagedProperty ectAlias;</pre>
<pre> ManagedProperty ectStrategyPlan;</pre>
<pre class="alt"> </pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectID"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectID = properties.Create(<span class="str">"ectID"</span>, ManagedDataType.Text);</pre>
<pre> ectID.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectID = properties[<span class="str">"ectID"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectTitle"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectTitle = properties.Create(<span class="str">"ectTitle"</span>, ManagedDataType.Text);</pre>
<pre> ectTitle.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectTitle = properties[<span class="str">"ectTitle"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectStartDate"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectStartDate = properties.Create(<span class="str">"ectStartDate"</span>, ManagedDataType.DateTime);</pre>
<pre> ectStartDate.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectStartDate.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectStartDate = properties[<span class="str">"ectStartDate"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectEndDate"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectEndDate = properties.Create(<span class="str">"ectEndDate"</span>, ManagedDataType.DateTime);</pre>
<pre class="alt"> ectEndDate.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectEndDate.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectEndDate = properties[<span class="str">"ectEndDate"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectEntity"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectEntity = properties.Create(<span class="str">"ectEntity"</span>, ManagedDataType.Text);</pre>
<pre> ectEntity.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectEntity.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectEntity = properties[<span class="str">"ectEntity"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectType"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectType = properties.Create(<span class="str">"ectType"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectType.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectType.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectType = properties[<span class="str">"ectType"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectOrganizationUnit"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectOrganizationUnit = properties.Create(<span class="str">"ectOrganizationUnit"</span>, ManagedDataType.Text);</pre>
<pre> ectOrganizationUnit.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectOrganizationUnit.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> ectOrganizationUnit = properties[<span class="str">"ectOrganizationUnit"</span>];</pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectOwner"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectOwner = properties.Create(<span class="str">"ectOwner"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectOwner.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectOwner.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectOwner = properties[<span class="str">"ectOwner"</span>];</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectAlias"</span>))</pre>
<pre> {</pre>
<pre class="alt"> ectAlias = properties.Create(<span class="str">"ectAlias"</span>, ManagedDataType.Text);</pre>
<pre> ectAlias.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre class="alt"> ectAlias.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre> ectAlias.MaxCharactersInPropertyStoreIndex = 450;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectAlias = properties[<span class="str">"ectAlias"</span>];</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="kwrd">if</span> (!properties.Contains(<span class="str">"ectStrategyPlan"</span>))</pre>
<pre class="alt"> {</pre>
<pre> ectStrategyPlan = properties.Create(<span class="str">"ectStrategyPlan"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> ectStrategyPlan.EnabledForScoping = <span class="kwrd">true</span>;</pre>
<pre> ectStrategyPlan.HasMultipleValues = <span class="kwrd">false</span>;</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">else</span></pre>
<pre class="alt"> ectStrategyPlan = properties[<span class="str">"ectStrategyPlan"</span>];</pre>
<pre> </pre>
<pre class="alt"> </pre>
<pre> <span class="rem">//TODO: ADD THE NEW FIELDS ADDED TO THE VIEW AFTER FINALIZATION</span></pre>
<pre class="alt"> <span class="rem">//Map the Query Crawled Properties to the Managed Property</span></pre>
<pre> MaptoManagedProperty(context, ectID, ModelName + <span class="str">" Items.ID"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectTitle, ModelName + <span class="str">" Items.Name"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectStartDate, ModelName + <span class="str">" Items.StartDate"</span>, ManagedDataType.DateTime);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectEndDate, ModelName + <span class="str">" Items.EndDate"</span>, ManagedDataType.DateTime);</pre>
<pre> MaptoManagedProperty(context, ectEntity, ModelName + <span class="str">" Items.Entity"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectType, ModelName + <span class="str">" Items.Type"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectOrganizationUnit, ModelName + <span class="str">" Items.OrganizationUnit"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectOwner, ModelName + <span class="str">" Items.Owner"</span>, ManagedDataType.Text);</pre>
<pre> MaptoManagedProperty(context, ectAlias, ModelName + <span class="str">" Items.Alias"</span>, ManagedDataType.Text);</pre>
<pre class="alt"> MaptoManagedProperty(context, ectStrategyPlan, ModelName + <span class="str">" Items.StrategyPlan"</span>, ManagedDataType.Text);</pre>
<pre> }</pre>
<pre class="alt"> </pre>
<pre> <span class="rem">/// <summary></span></pre>
<pre class="alt"> <span class="rem">/// Maps the external content type columns to a specific Managed Property</span></pre>
<pre> <span class="rem">/// </summary></span></pre>
<pre class="alt"> <span class="rem">/// <param name="context">The Search context to map the the external content type columns within</param></span></pre>
<pre> <span class="rem">/// <param name="managedProperty">The managed property to map the column to</param></span></pre>
<pre class="alt"> <span class="rem">/// <param name="crawledPropertyName">The crawled property "Column" Name</param></span></pre>
<pre> <span class="rem">/// <param name="DataType"></param></span></pre>
<pre class="alt"> <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">void</span> MaptoManagedProperty(SearchContext context, ManagedProperty managedProperty, <span class="kwrd">string</span> crawledPropertyName, ManagedDataType DataType)</pre>
<pre> {</pre>
<pre class="alt"> SPSecurity.RunWithElevatedPrivileges(() =></pre>
<pre> {</pre>
<pre class="alt"> Schema schema = <span class="kwrd">new</span> Schema(context);</pre>
<pre> </pre>
<pre class="alt"> <span class="kwrd">try</span></pre>
<pre> {</pre>
<pre class="alt"> Category category = schema.AllCategories[<span class="str">"Business Data"</span>];</pre>
<pre> <span class="kwrd">var</span> crawledProps = category.QueryCrawledProperties(crawledPropertyName, 1, Guid.NewGuid(), String.Empty, <span class="kwrd">true</span>).Cast<CrawledProperty>();</pre>
<pre class="alt"> <span class="kwrd">var</span> crawledProp = crawledProps.FirstOrDefault();</pre>
<pre> <span class="kwrd">if</span> (crawledProp != <span class="kwrd">null</span>)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">var</span> mappings = managedProperty.GetMappings();</pre>
<pre class="alt"> mappings.Add(<span class="kwrd">new</span> Mapping(crawledProp.Propset, crawledProp.Name, crawledProp.VariantType, managedProperty.PID));</pre>
<pre> managedProperty.SetMappings(mappings);</pre>
<pre class="alt"> managedProperty.Update();</pre>
<pre> }</pre>
<pre class="alt"> <span class="kwrd">else</span></pre>
<pre> {</pre>
<pre class="alt"> Console.WriteLine(<span class="str">"Query Crawled Property "</span> + crawledPropertyName + <span class="str">" was not found - Mapping faild."</span>);</pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre> <span class="kwrd">catch</span> (Exception ex)</pre>
<pre class="alt"> {</pre>
<pre> <span class="kwrd">throw</span> <span class="kwrd">new</span> Exception(<span class="str">"Faild to map field to Crawled Property \n"</span> + ex.Message);</pre>
<pre class="alt"> }</pre>
<pre> });</pre>
<pre class="alt"> </pre>
<pre> }</pre>
<pre class="alt"> }</pre>
<pre>}</pre>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-30168316196920680912013-01-29T12:34:00.000+02:002014-11-11T09:18:08.245+02:00Disable (Read-only) for sharepoint 2010 People Picker (PeopleEditor)<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Using the SharePoint 2010 People Picker (People Editor) user control in your custom visual web part is very powerful tool (which by the way makes you web part looks nice "JUST KIDDING IT IS SHIT" ) .<br />
<br />
Any way .... you may be depressed and forced by the business needs to use this shit control, also by business needs you may want to disable this control programmatically to and use it only for display "Read Only". What we have learned in the ASP.NET is that any web control should have the property "Enabled" which if you ever set it to false the control is not enabled "LOGIC" , but hell no , The people picker do not offer you the easy way.<br />
So lets have the following scenario, You want to auto fill this control in the page load with a specific user then disable it.<br />
<br />
Assuming you have the following people editor control on your page or web part </div>
<pre style="background-image: URL(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhd3tkcUfO9vGD9ys2kK4bPezMzz5wBkICvBJ41EOWZkmV0hT3ukzTeTH2lvIpFlb5x_vMyiUqoQDSW17UxsGJLJmCJG6L57waRX-JH4zSxSbfTXZYqIy6ZgrU0Ijj4rPFOzp6acOBDsHED/s320/codebg.gif); background: #f0f0f0; border: 1px dashed #CCCCCC; color: black; font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <SharePoint:PeopleEditor ID="PeoplePickerOwner" runat="server" Width="350" SelectionSet="User" MultiSelect="false" AllowEmpty="true" ValidationGroup="AdvancedSearchVld" />
</code></pre>
<br />
To auto fill and disable this control use the following method<br />
<br />
<br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">private</span> <span class="kwrd">void</span> SetOwnerUser()</pre>
<pre><span class="lnum"> 2: </span> {</pre>
<pre class="alt"><span class="lnum"> 3: </span> <span class="kwrd">if</span> (CurrentUser != <span class="kwrd">null</span>)</pre>
<pre><span class="lnum"> 4: </span> {</pre>
<pre class="alt"><span class="lnum"> 5: </span> PeoplePickerOwner.Entities.Clear();</pre>
<pre><span class="lnum"> 6: </span> PickerEntity UserEntity = <span class="kwrd">new</span> PickerEntity();</pre>
<pre class="alt"><span class="lnum"> 7: </span> UserEntity.DisplayText = CurrentUser.Name;</pre>
<pre><span class="lnum"> 8: </span> UserEntity.Key = CurrentUser.LoginName;</pre>
<pre class="alt"><span class="lnum"> 9: </span> PeoplePickerOwner.Entities.Add(PeoplePickerOwner.ValidateEntity(UserEntity));</pre>
<pre><span class="lnum"> 10: </span> PeoplePickerOwner.ShowButtons = <span class="kwrd">false</span>;</pre>
<pre class="alt"><span class="lnum"> 11: </span> PeoplePickerOwner.AllowTypeIn = <span class="kwrd">false</span>;</pre>
<pre><span class="lnum"> 12: </span> }</pre>
<pre class="alt"><span class="lnum"> 13: </span> }</pre>
<pre class="alt"></pre>
<pre class="alt"></pre>
<pre class="alt"></pre>
<pre class="alt"></pre>
<pre class="alt"><span style="font-family: Times New Roman;"><span style="white-space: normal;"><b>UPDATE: </b>Danial Martins asked "</span></span><span style="background-color: white; color: #666666; font-family: 'Trebuchet MS', Trebuchet, Verdana, sans-serif; font-size: 12px; line-height: 16.7999992370605px; text-align: justify;">I select the name press backspace it deletes it. Is there a workaround?</span><span style="font-family: 'Times New Roman'; white-space: normal;">", Thanks to Hoshang Akeryi, Below is the solution:</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
<!-- HTML generated using hilite.me --><div style="background: #f0f0f0; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<table><tbody>
<tr><td><pre style="line-height: 125%; margin: 0;">1
2
3
4
5
6
7
8
9</pre>
</td><td><pre style="line-height: 125%; margin: 0;">ppl.ShowButtons <span style="color: #666666;">=</span> <span style="color: #007020; font-weight: bold;">false</span>;
ppl.AllowTypeIn <span style="color: #666666;">=</span> <span style="color: #007020; font-weight: bold;">false</span>;
than add the script to your page<span style="color: #666666;">:</span>
<span style="color: #666666;"><</span>script type<span style="color: #666666;">=</span><span style="color: #4070a0;">"text/javascript"</span><span style="color: #666666;">></span>
$(<span style="color: #007020;">document</span>).ready(<span style="color: #007020; font-weight: bold;">function</span> ()
{
$(<span style="color: #007020; font-weight: bold;">this</span>).find(<span style="color: #4070a0;">"div[Title='People Picker']"</span>).attr(<span style="color: #4070a0;">"contentEditable"</span>,<span style="color: #007020; font-weight: bold;">false</span>);
}
<span style="color: #666666;"><</span><span style="border: 1px solid #FF0000;">/script></span>
</pre>
</td></tr>
</tbody></table>
</div>
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;">
</span></pre>
<pre class="alt"><span style="font-family: 'Times New Roman'; white-space: normal;"><script type="text/javascript">
$(document).ready(function ()
{
$(this).find("div[Title='People Picker']").attr("contentEditable",false);
}
</script></span></pre>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com2tag:blogger.com,1999:blog-7265446347879207534.post-13104773331826067672013-01-21T14:51:00.000+02:002013-02-05T13:12:12.194+02:00Reset-Set-validate-Resolve Sharepoint people picker By javascript<div dir="ltr" style="text-align: left;" trbidi="on">
<link href="csharp.css" rel="stylesheet" type="text/css"></link>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
SharePoint 2010 people picker is a very useful control to be used on your custom forms or custom visual webparts to select people within your corporate .<br />
<br />
Some of the clients requirements would specify to preload this field with some values <a href="http://stackoverflow.com/questions/12174181/set-peoplepicker-default-value-with-current-user-with-js" target="_blank">by default as the current logged in user </a>, ok what about doing this in the client side , Now everyone is going towards the client side operations , we do not want to exhaust the server those operations.<br />
<br />
People picker could be handled by javascript methods:<br />
<br />
<u><b>To Reset the people picker value you could use:</b></u></div>
</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>function ResetPP() {</pre>
<pre><span class="lnum"> 2: </span> <span class="kwrd">var</span> identifier = <span class="str">'<%= PeoplePicker.ClientID%>'</span>;</pre>
<pre class="alt"><span class="lnum"> 3: </span> <span class="kwrd">var</span> value = <span class="str">''</span>;</pre>
<pre><span class="lnum"> 4: </span> <span class="kwrd">var</span> tags = document.getElementsByTagName(<span class="str">'DIV'</span>);</pre>
<pre class="alt"><span class="lnum"> 5: </span> </pre>
<pre><span class="lnum"> 6: </span> <span class="kwrd">for</span> (<span class="kwrd">var</span> i = 0; i < tags.length; i++) {</pre>
<pre class="alt"><span class="lnum"> 7: </span> <span class="kwrd">var</span> tempString = tags[i].id;</pre>
<pre><span class="lnum"> 8: </span> <span class="kwrd">if</span> ((tempString.startsWith(identifier)) && (tempString.indexOf(<span class="str">'_upLevelDiv'</span>) > 0)) {</pre>
<pre class="alt"><span class="lnum"> 9: </span> tags[i].innerHTML = value;</pre>
<pre><span class="lnum"> 10: </span> <span class="kwrd">break</span>;</pre>
<pre class="alt"><span class="lnum"> 11: </span> }</pre>
<pre><span class="lnum"> 12: </span> }</pre>
<pre class="alt"><span class="lnum"> 13: </span> }</pre>
</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<br />
<br />
<u><b>To Set the People Picker with a certain value:</b></u><br />
to use it something like : <br />
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>SetPP(<span class="str">'<%=PeoplePicker.ClientID%>'</span>, <span class="str">'sps\administrator'</span>);</pre>
<pre class="alt"> </pre>
The Method:
</div>
</div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>function SetPP(identifier ,value) {</pre>
<pre><span class="lnum"> 2: </span> </pre>
<pre class="alt"><span class="lnum"> 3: </span> <span class="kwrd">var</span> tags = document.getElementsByTagName(<span class="str">'DIV'</span>);</pre>
<pre><span class="lnum"> 4: </span> </pre>
<pre class="alt"><span class="lnum"> 5: </span> <span class="kwrd">for</span> (<span class="kwrd">var</span> i = 0; i < tags.length; i++) {</pre>
<pre><span class="lnum"> 6: </span> <span class="kwrd">var</span> tempString = tags[i].id;</pre>
<pre class="alt"><span class="lnum"> 7: </span> <span class="kwrd">if</span> ((tempString.startsWith(identifier)) && (tempString.indexOf(<span class="str">'_upLevelDiv'</span>) > 0)) {</pre>
<pre><span class="lnum"> 8: </span> tags[i].innerHTML = value;</pre>
<pre class="alt"><span class="lnum"> 9: </span> <span class="kwrd">break</span>;</pre>
<pre><span class="lnum"> 10: </span> }</pre>
<pre class="alt"><span class="lnum"> 11: </span> }</pre>
<pre><span class="lnum"> 12: </span> }</pre>
<pre> </pre>
<u><b>Find if the People Picker is resolved:
</b></u></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>function IsPeoplePickerValueResolved() {</pre>
<pre><span class="lnum"> 2: </span> <span class="kwrd">var</span> eEntityData = $(<span class="str">"div[id='divEntityData']"</span>);</pre>
<pre class="alt"><span class="lnum"> 3: </span> <span class="kwrd">if</span> (eEntityData.length > 0) {</pre>
<pre><span class="lnum"> 4: </span> <span class="kwrd">var</span> isResolved = eEntityData.attr(<span class="str">"isresolved"</span>);</pre>
<pre class="alt"><span class="lnum"> 5: </span> <span class="kwrd">return</span> (isResolved == <span class="str">"True"</span>);</pre>
<pre><span class="lnum"> 6: </span> }</pre>
<pre class="alt"><span class="lnum"> 7: </span> <span class="kwrd">return</span> <span class="kwrd">false</span>;</pre>
<pre><span class="lnum"> 8: </span> }</pre>
<pre> </pre>
<u><b>Validate the People Picker:</b></u> </div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>function ValidateOwner(PeoplePickerOwner, PeoplePickerContextName) {</pre>
<pre><span class="lnum"> 2: </span> <span class="kwrd">if</span> (!ValidatePickerControl(PeoplePickerOwner.id)) {</pre>
<pre class="alt"><span class="lnum"> 3: </span> ShowValidationError();</pre>
<pre><span class="lnum"> 4: </span> <span class="kwrd">return</span> <span class="kwrd">false</span>;</pre>
<pre class="alt"><span class="lnum"> 5: </span> }</pre>
<pre><span class="lnum"> 6: </span> <span class="kwrd">var</span> arg = getUplevel(PeoplePickerOwner.id);</pre>
<pre class="alt"><span class="lnum"> 7: </span> <span class="kwrd">var</span> ctx = PeoplePickerOwner.id;</pre>
<pre><span class="lnum"> 8: </span> EntityEditorSetWaitCursor(ctx);</pre>
<pre class="alt"><span class="lnum"> 9: </span> WebForm_DoCallback(PeoplePickerContextName, arg, EntityEditorHandleCheckNameResult, ctx, EntityEditorHandleCheckNameError, <span class="kwrd">true</span>);</pre>
<pre><span class="lnum"> 10: </span> <span class="kwrd">return</span> <span class="kwrd">false</span>;</pre>
<pre class="alt"><span class="lnum"> 11: </span> }</pre>
<pre class="alt"> </pre>
To <u><b>use </b></u>this method you can use the following:<br />
<br /></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">var</span> PeoplePickerOwner = document.getElementById(<span class="str">'<%= PeoplePicker.ClientID %>'</span>);</pre>
<pre><span class="lnum"> 2: </span><span class="kwrd">var</span> PeoplePickerOwnerHiddenSpanData = document.getElementById(<span class="str">'<%= PeoplePickerOwner.ClientID + "_hiddenSpanData"%>'</span>);</pre>
<pre class="alt"><span class="lnum"> 3: </span><span class="kwrd">var</span> PeoplePickerContextName = $(<span class="str">"#"</span> + PeoplePickerOwnerHiddenSpanData.id).attr(<span class="str">"name"</span>).replace(<span class="str">"$hiddenSpanData"</span>, <span class="str">""</span>);</pre>
<pre><span class="lnum"> 4: </span> </pre>
<pre class="alt"><span class="lnum"> 5: </span>ValidateOwner(PeoplePickerOwner, PeoplePickerContextName);</pre>
<pre class="alt"> </pre>
<u><b>To call the "Click" the check names button:
</b></u></div>
<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: Consolas, "Courier New", Courier, Monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<br />
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>function ClickCheckName() {</pre>
<pre><span class="lnum"> 2: </span> document.getElementById(<span class="str">'<%=PeoplePicker.ClientID%>'</span> + <span class="str">"_checkNames"</span>).click();</pre>
<pre class="alt"><span class="lnum"> 3: </span> }</pre>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com4tag:blogger.com,1999:blog-7265446347879207534.post-49848247601823558182012-11-28T15:28:00.002+02:002012-11-28T15:28:13.783+02:00When to use the Content Search Web Part (CSWP) or the Content Query Web Part (CQWP)<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
The Content Search Web Part (CSWP) is a Web Part introduced
in SharePoint 2013 that uses various styling options to display dynamic content
on SharePoint pages. But when do we use CSWP or the CQWB</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
First this is a link to introduce the Content Search Web
Part (CSWP)</div>
<div class="MsoNormal">
<a href="http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=185">http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=185</a>
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now to decide any one to use, The CSWP can return any
content from the search index. Use it on your SharePoint 2013 sites when you
are connecting to a search service and want to return indexed search results in
your pages.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The CSWP returns content that is as fresh as the latest
crawl of your content, so if you crawl often, the content that the CSWP returns
is more up-to-date than if you crawl infrequently. If you need to display
instant content or the refreshed version of content, use the Content Query Web
Part (CQWP) instead.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Search crawls only the major versions of content, never the
minor versions. If you want to display the minor versions of your content, do
that by using a CQWP.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Some site collection administrators mark sites to not be
indexed. Content marked in this way is not available in a CSWP. If you want to
return results from a site that is marked to not index, use the CQWP instead.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Reference: <a href="http://msdn.microsoft.com/en-us/library/jj163789%28v=office.15%29.aspx">http://msdn.microsoft.com/en-us/library/jj163789%28v=office.15%29.aspx</a>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-48768796554289292882012-11-28T15:27:00.002+02:002012-11-29T16:11:27.186+02:00Mixed Http and Https Content with SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
Hello All,</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Securing your claims authenticated publishing web application specially FBA
sites is very important if your content have very valuable data , but what all
we need here is to secure the important pages in the site we are implementing
(Registration – Forget password – Login – any pages with valuable data “Visa
Cards, Enterprise data , etc …..”), the steps to approve that is
very simple .</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">1-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>First you have to plan the architecture and permission levels
for the anonymous and authenticated user (Optional)</div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<a href="http://blogs.visigo.com/chriscoulson/mixed-anonymous-and-secure-content-with-sharepoint-2010/">http://blogs.visigo.com/chriscoulson/mixed-anonymous-and-secure-content-with-sharepoint-2010/</a>
</div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">2-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>Then you have to configure SSL over your web application pool or
the extended zone web application pool</div>
<div class="MsoListParagraph" style="text-indent: .5in;">
<a href="http://blogs.visigo.com/chriscoulson/mixed-http-and-https-content-with-sharepoint-2010/">http://blogs.visigo.com/chriscoulson/mixed-http-and-https-content-with-sharepoint-2010/</a>
</div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">3-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>You will notice that during the implementation for SSL that
Notice that even if you authenticate via https, your authentication isn’t
recognized when you switch over to http. The reason for this is because
SharePoint has hard-coded logic that says if it’s generating an authentication
token for an https connection, then turn on the SSL Only flag on the cookie. An
SSL Only flag means that the cookie can only be accessed via https. So as soon
as you change the address to http, your authentication cookie is no longer
recognized and you have to login again. The following post resolved this issue </div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<a href="http://www.sp2010hosting.com/Lists/Posts/Post.aspx?ID=5">http://www.sp2010hosting.com/Lists/Posts/Post.aspx?ID=5</a>
</div>
<div class="MsoListParagraph" style="margin-left: 1.0in;">
<br /></div>
<div class="MsoNormal">
Voila !! The important pages in your site is now secured ,
and can feel secure & safe <span style="font-family: Wingdings;">J</span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><u>Note:</u></b> You can decide whether to secure the
whole site or specific pages in your site just a matter of implementation
and your business needs </div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-72859194218270992332012-11-28T15:26:00.006+02:002012-11-29T16:09:14.294+02:00Preventing authenticated visitors from browsing system pages<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
SharePoint Publishing sites became a very important trend in
the SharePoint world , but thinking that your site will face the public users
through the internet and your system pages will be vulnerable for users –
even those users are authenticated against any provider FBA or third party –
that is a big issue, This issue is a “Heart attack” for your public site.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Surfing for the solution, I found a lot trends for avoiding
this problem , but I think that the following solution is very easy and strait
forward one. So I wanted to share the solution – may be helpful for
someone- </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Kindly find this link: <a href="http://blog.mastykarz.nl/preventing-authenticated-visitors-browsing-system-pages/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+WaldekMastykarz+%28Waldek+Mastykarz%29&utm_content=Google+Reader">http://blog.mastykarz.nl/preventing-authenticated-visitors-browsing-system-pages/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+WaldekMastykarz+%28Waldek+Mastykarz%29&utm_content=Google+Reader</a>
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Hope this link is helpful.</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-38508386844063087082012-11-28T15:26:00.002+02:002012-11-29T16:08:44.942+02:00Enabling you published Sharepoint Site -Full Site - on mobile phones and tablets<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
One interesting feature of SharePoint 2010 is that it
automatically shows a nice mobile experience when mobile devices browse the
site. There is no need to type in the mobile URL (by appending /m to the URL). </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
While this is terrific for intranet sites, its less than ideal for public
internet sites, especially ones that have a lot of custom branding. In those
cases, typically you would want smart phones like the iPhone , Android phones
to see a standard rendering of your site. So, how do we turn off the automatic
mobile experience? There doesn’t appear to be a setting for this in the Site
Settings or in Central Administration. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Solution:</div>
<div class="MsoNormal" style="text-indent: .5in;">
Turns out you need to edit the
“compat.browser” file for your SharePoint site. To find this file, look in your
IIS directory for your SharePoint site and look for the App_Browsers folder.
Mine file was located at:
C:\inetpub\wwwroot\wss\VirtualDirectories\2020\App_Browsers\compat.browse</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
This file has settings for MANY popular browsers, including
most mobile browsers, so I located all tags looking like “<capability
name="isMobileDevice" value="true" />” and changed the value property to “false” .</div>
<div class="MsoNormal">
<br /></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; mso-ansi-language: EN-US; mso-bidi-language: AR-SA; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin;">now when I browse my SharePoint site I see the
standard branding, just like the desktop full site version</span></div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-66259149755120272942012-11-28T15:25:00.001+02:002012-12-02T15:36:52.384+02:00Using Page Output Cache with Content by Query web part<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoListParagraph" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">1-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>We have SharePoint 2010 internet facing site with page output
caching enabled.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">2-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>We have one IMtech CQWP with 2 paging parameters.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l1 level1 lfo1; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">3-<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span>This is not working when we do caching. Once I remove caching
paging works</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span dir="LTR"></span>/Pages/default.aspx?p=1 -> results for page one</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="margin-left: .75in; mso-list: l2 level1 lfo2; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span dir="LTR"></span>/Pages/default.aspx?p=2 -> Cached result for page one</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
I found <b><u>Vary
by Query String</u></b><u> <b>Parameters</b></u> option. Which was a life
saver, as we can’t just get rid of caching – for Performance wise</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><u>Solution:</u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo3; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span dir="LTR"></span>In the Site collection
cache profiles, Edit the “<b>Public Internet (Purely Anonymous)</b>” cache
profile.</div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo3; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span dir="LTR"></span>Locate the “<b>Vary by
Query String Parameters</b>” property.</div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo3; text-indent: -.25in;">
<span style="mso-fareast-font-family: Calibri;"><span style="mso-list: Ignore;">-<span style="font: 7.0pt "Times New Roman";">
</span></span></span><span dir="LTR"></span>Right down all the
parameters you want separated by ‘,’ e.x. p,pNavigation,pHome</div>
<div class="MsoListParagraph">
<br /></div>
<div class="MsoListParagraph">
This way your cache will work as follow, <span style="font-family: "Arial","sans-serif"; font-size: 10.0pt;">all URL with any
query string will be considered as separate URL and <b><u>cached separately</u></b></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<b><u>References : </u></b></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<a href="http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/b72876eb-f547-43e3-a059-c4a90ec52154">http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/b72876eb-f547-43e3-a059-c4a90ec52154</a>
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<a href="http://blogs.msdn.com/b/ryadav/rss.aspx">http://blogs.msdn.com/b/ryadav/rss.aspx</a>
</div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-1565881666451316752012-11-28T15:24:00.001+02:002012-11-28T15:24:05.204+02:00Upgrading from SharePoint 2010 Windows classic Authintecation to SharePoint 2013 Claims<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<ul style="margin-top: 0in;" type="square">
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="mso-fareast-font-family: "Times New Roman";">SharePoint
15 continues to offer support for both claims and classic authentication
modes</span></li>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="mso-fareast-font-family: "Times New Roman";">However
</span><b><u><span style="font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">claims
authentication</span></u></b><span style="font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="mso-fareast-font-family: "Times New Roman";">is
<b>THE</b> </span><b><u><span style="font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";">default</span></u></b><span style="font-size: 12.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="mso-fareast-font-family: "Times New Roman";">authentication option now</span></li>
<ul style="margin-top: 0in;" type="square">
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level2 lfo1; tab-stops: list 1.0in;"><span style="mso-fareast-font-family: "Times New Roman";">Classic
authentication mode is still there, but can only be managed in PowerShell
– it’s gone from the UI </span></li>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level2 lfo1; tab-stops: list 1.0in;"><span style="mso-fareast-font-family: "Times New Roman";">Support
for classic mode is deprecated and will go away in a future release, so
we recommend moving to Claims </span></li>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level2 lfo1; tab-stops: list 1.0in;"><span style="mso-fareast-font-family: "Times New Roman";">There
also a new process to migrate accounts from Windows classic to Windows
claims</span></li>
</ul>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="mso-fareast-font-family: "Times New Roman";">The
MigrateUsers method in SharePoint 2010 is no longer the correct way to
migrate accounts – it is now deprecated</span></li>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="mso-fareast-font-family: "Times New Roman";">A new
cmdlet has been created called Convert-SPWebApplication<b> </b></span></li>
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level1 lfo1; tab-stops: list .5in;"><span style="mso-fareast-font-family: "Times New Roman";">A
simple example – you have a Windows classic web application</span></li>
<ul style="margin-top: 0in;" type="square">
<li class="MsoNormal" style="color: #1f497d; mso-list: l1 level2 lfo1; tab-stops: list 1.0in;"><span style="mso-fareast-font-family: "Times New Roman";">Run
Convert-SPWebApplication -Identity "<a href="http://yourwebapp/">http://yourWebapp</a>"
-To Claims –RetainPermissions [-Force] </span></li>
</ul>
</ul>
<div class="MsoNormal">
<span style="color: #1f497d;">
</span></div>
<div class="MsoNormal">
<b><span style="color: #1f497d;">
<u>Other Claims Migration Scenarios:</u></span></b></div>
<div class="MsoNormal" style="margin-left: .75in; mso-list: l0 level1 lfo2; tab-stops: list .75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">You have an existing Windows claims
application and you want to bring over content from a SharePoint 2010 Windows
classic web app</span></div>
<div class="MsoNormal" style="margin-left: 1.25in; mso-list: l0 level2 lfo2; tab-stops: list 1.25in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Option 1 (the safest):</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Create a web application in o15 that
uses Windows classic authentication</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Attach the SharePoint 2010 content
database to this o15 web app</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Attaching it will upgrade it to the
o15 database format, so verify that it is working correctly after attach</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Run the Convert-SPWebApplication
command on the o15 web app to convert the users from Windows classic to Windows
claims</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Detach the content database from the
o15 Windows classic web app</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Attach the content database to it’s
final o15 Windows claims web app</span></div>
<div class="MsoNormal" style="margin-left: 1.25in; mso-list: l0 level2 lfo2; tab-stops: list 1.25in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Option 2 (the quickest):</span></div>
<div class="MsoNormal" style="margin-left: 1.75in; mso-list: l0 level3 lfo2; tab-stops: list 1.75in; text-indent: -.25in;">
<span style="color: #1f497d; font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings;"><span style="mso-list: Ignore;">§<span style="font: 7.0pt "Times New Roman";"> </span></span></span><span dir="LTR"></span><span style="color: #1f497d;">Attach the content DB to an existing
Windows claims web application Run the Convert-SPWebApplication cmdlet again on
the web app</span></div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com1tag:blogger.com,1999:blog-7265446347879207534.post-76668392011210580102012-11-28T15:23:00.004+02:002012-11-29T16:09:48.883+02:00Variations propagate pages on your terms<div dir="ltr" style="text-align: left;" trbidi="on">
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>AR-SA</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><br />
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
</style>
<![endif]-->
<br />
<div class="MsoNormal">
Page propagation is triggered by publishing a page on the
source variation site by default. Each time you publish a source page, the
Variations Event Receiver adds a work item to the Variations Propagate Pages
timer job queue. When the timer job runs, it will begin executing the first 100
page propagation work items. For each work item, Variations will copy the
source page to all target sites, creating the page if it does not yet exist, or
appending a draft minor version if the target page does already exist.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
In some cases, users might not want changes to a page on the
source to necessarily propagate to all targets. That is, users might want to
make source-local changes and have the option to make changes globally
applicable when they want. This often takes the form of a question like
"How can I stop variations from overwriting my target pages every time I
publish a source page?" Variations in SharePoint 2010 helps you do this.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The Answer is Enable On-Demand Page Propagation.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<a href="http://blogs.msdn.com/b/ecm/archive/2010/06/22/variations-propagate-pages-on-your-terms.aspx">http://blogs.msdn.com/b/ecm/archive/2010/06/22/variations-propagate-pages-on-your-terms.aspx</a>
</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Hope this is a useful piece of Information <span style="font-family: Wingdings;">J</span></div>
</div>
Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-5300425205757701542012-03-08T12:41:00.000+02:002012-03-08T12:41:11.493+02:00EMail your Datagrid SharePoint 2010<div dir="ltr" style="text-align: left;" trbidi="on">Hello all,<br />
<br />
In this post we will discuss the shortest way to send the Results of a data grid in the content of E-Mail with its HTML.<br />
<br />
Our Game Plan:<br />
1- Do your logic Bind the Data grid get the result.<br />
2- Extract the HTML of the data grid.<br />
3- Build the XSL fro your Mail formattting.<br />
4- Send the mail.<br />
<br />
I'll skip step 1 as it is very easy and you will find it all over the Internet.<br />
<br />
Assuming we have our Data grid binded noe we need to extract thos results as HTML how we will do that by,<br />
this Method<br />
private string GetGridHTML()<br />
{<br />
StringBuilder SB = new StringBuilder();<br />
StringWriter SW = new StringWriter(SB);<br />
HtmlTextWriter htmlTW = new HtmlTextWriter(SW);<br />
<br />
grdMyDataGrid.RenderControl(htmlTW);<br />
<br />
string dataGridHTML = SB.ToString();<br />
<br />
//dataGridHTML = Server.HtmlEncode(dataGridHTML);<br />
<br />
return dataGridHTML;<br />
}<br />
<br />
this code will give exception <span style="font-size: small;">GridView must be placed inside a form tag with runat=“server” even after the GridView is within a form tag</span><br />
<br />
You are calling <code>GridView.RenderControl(htmlTextWriter)</code>, hence the page raises an exception that a Server-Control was rendered outside of a Form. <br />
You could avoid this execption by overriding <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.verifyrenderinginserverform.aspx" rel="nofollow">VerifyRenderingInServerForm</a><br />
<br />
<pre class="lang-cs prettyprint"><code><span class="kwd">public</span><span class="pln"> </span><span class="kwd">override</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> </span><span class="typ">VerifyRenderingInServerForm</span><span class="pun">(</span><span class="typ">Control</span><span class="pln"> control</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */</span><span class="pln">
</span><span class="pun">}</span></code></pre><pre class="lang-cs prettyprint"><code><span class="pun"> </span></code></pre><pre class="lang-cs prettyprint"><code><span class="pun">Ok now we have our Data grid content HTML </span><span class="pln">.</span></code></pre><pre class="lang-cs prettyprint"><code><span class="pln">
</span></code></pre><pre class="lang-cs prettyprint"><code><span class="pln">
</span></code></pre></div>Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-82090505518867336192012-01-10T12:58:00.000+02:002012-01-10T12:59:15.779+02:00Contetn by Query webpart customization<div dir="ltr" style="text-align: left;" trbidi="on"><div style="width:425px" id="__ss_10933640"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/IslamKhattab/content-by-query-web-part" title="Content by query web part">Content by query web part</a></strong><object id="__sse10933640" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=contentbyquerywebpart-120110045711-phpapp02&stripped_title=content-by-query-web-part&userName=IslamKhattab" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><param name="wmode" value="transparent"/><embed name="__sse10933640" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=contentbyquerywebpart-120110045711-phpapp02&stripped_title=content-by-query-web-part&userName=IslamKhattab" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="425" height="355"></embed></object><div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/IslamKhattab">IslamKhattab</a>.</div></div></div>Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com0tag:blogger.com,1999:blog-7265446347879207534.post-2263686626461227662011-07-25T15:06:00.000+02:002011-07-25T15:06:03.044+02:00Applying your FBA configuration to production environment - Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response) +1161013<div dir="ltr" style="text-align: left;" trbidi="on">OK, we have discussed the steps of configuring your SharePoint site to use FBA , I've configured it many and many times , but there was a case where it was required that the Web Front End for our site will be on two servers , ok a little detail i found that when you deploy your site in several WFEs you need to configure in three places<br />
1- Your Central Admin Application pool<br />
<br />
2- your STS (Security Token Service).<br />
<br />
3- In each WFE<br />
<br />
so what, I configured them all as usual , every thing is fine , testing the login page , oooooooooooooooops an error page (NOT SHAREPOINT ERROR) ASP.NET error page, ok calm down enable custom error , and i got - Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(Message response) +1161013- what is this ??? , I assumed that the error was not ASP its SharePoint ,opened the LOGS file and i found that the user i created from the central admin sever , couldn't be verified by the WFE as i configured my ASPMembership provider to encrypt the passwords, And of course as we all know that the password is encrypted by the machine-key which differs from one machine to the other , ok there is a solution for this issue , open your web.config on one of your WFEs , find the "machineKey" tag it looks like the following <machineKey validationKey="424B56AB4FC235300974BB13CE70F69987166E4F690DFF0F" decryptionKey="FED66B56701EB68F15C714D84DC8C7434F2445167DE802E8" validation="SHA1" /> copy it and paste it to all the WFEs using your site , Now all the WFEs are Decrypting-Encrypting using the same key. Mission Accomplished !!!! </div>Islam Khattabhttp://www.blogger.com/profile/17570451827916728100noreply@blogger.com2