Thursday, July 23, 2015
http://smtp4dev.codeplex.com/downloads/get/269147
https://www.webucator.com/tutorial/advanced-microsoft-sharepoint/document-id-service.cfm
Document ID Service
SharePoint's Document ID service, available with the pay versions of SharePoint, creates unique IDs for documents that are prefixed with text the Site Collection Administrator defines. What's more is that the ID assigned to the document creates a fixed URL that can be used to link to the document even if it is moved to another library or site. The Document ID service can only be used on documents and cannot be used on list items.
The Document ID service is enabled at the Site Collection level by activating a feature. Once the service is activated the Site Collection Administrator can define the prefix string to be used. SharePoint uses a Timer Job, Document ID assignment job, to set the IDs on existing documents once the Document ID Service has been activated. The Timer Job runs every 24 hours by default so existing documents will not have the IDs until the job has run. A Farm administrator can manually run the job to have the IDs created sooner. New documents will have IDs created when the document is saved to the library.
Lesson Goals
- Learn what the Document ID feature does.
- Learn how to activate the Document ID feature in a Site Collection.
- Learn how to configure the Document ID feature settings.
- Learn how to force the Document ID feature timer jobs to run.
- Learn how to link to a document using the Document ID URL.
Activating the Document ID Feature
The following walk-through will show you how to activate the Document ID Service feature on a site collection.
This walk-through is the same as the first steps performed in the exercise at the end of the lesson. You can activate a feature only once for a Site Collection, so if you plan to do the exercise you can skip this walk-through. This walk-through can only be done on the pay versions of SharePoint.
- Activate the Document ID feature for the site collection of your root site.
- Click Settings menu and then choose Site Settings from the options.
- Click the Site Collection Features link in the Site Collection Administration group of the Site Settings page.

- Click the Activate button for the Document ID Service feature.

Configuring Document ID Settings
The following walk-through will show you how to configure the Document ID settings for the Site Collection to use an ID prefix of "Contoso" and to reset all existing documents with the ID. Once the setting is in place the walk-through will show you how to use Central Administration to force the Timer Jobs to run so you can verify the service is working without having to wait 24 hours for the service to run naturally.
This walk-through is the same as the steps performed in the exercise at the end of the lesson. If you plan to do the exercise, you can skip this walk-through.
- Configure the Site Collection Document ID Settings to prefix document IDs with "CONTOSO".
- Click the Settings menu and then choose Site Settings from the options.
- Click the Document ID settings link in the Site Collection Administration group of the Site Settings page.

- Type "CONTOSO" in the text-box field labeled Begin IDs with the following characters and check the box labeled Reset all Document IDs in this site Collection to begin with these characters.

- Click the OK button to save the new Document ID prefix.
- Use Central Administration to force the Document ID service timer jobs to run.
You can only perform these steps if you have access to your farm's Central Administration site. If you do not, you can skip these steps and wait 24 hours for it to naturally occur.
- Open a new browser tab and navigate to the Central Administration site for you SharePoint farm.
The default setup for this class calls for the Central Administration site to be accessible through "http://spserver2013:5000".
- Click the Monitoring link in the Central Administration site's Quick Launch.

- Click the Review job definitions link under the Timer Jobs group.

- Scroll down the list of Timer Jobs and locate and click the Document ID enable/disable job link.

- Click the Run Now button at the bottom of the job definition form.
- Scroll down the list of Timer Jobs and locate and click the Document ID assignment job link.

- Click the Run Now button at the bottom of the job definition form.
- Close the browser tab for Central Administration.
- Verify that Document IDs have been generated for documents in the Contoso Home Site.
- Click the Documents link in the Contoso Home Site site's Quick Launch menu.
- Hover and click the arrow to the right of the EvaluateSharePointServer2010-ITPro link and choose the View Properties from the options menu.
- Verify the Document ID property exists for the document and it has a value that starts with "CONTOSO".

If the document doesn't have an Document ID assigned to it yet, you will need to wait at least 30 minutes and then repeat the previous steps from Central Administration to force the timer jobs to run. Depending on the size of the Site Collection SharePoint uses an entry in the content database table calledScheduledWorkItems to delay the configuration of Document ID feature. If it's registered in this table running the timer jobs won't have any affect until the scheduled time elapses.
- Click the Close button to close the document's properties dialog.
Linking Documents Using Their Document ID
The main function of the Document ID service is to provide a hyperlink to the document that will work even if the document is moved to another library or even another site.
The Document ID service uses a redirect page, DocIdRedir.aspx, that takes the unique Document ID generated by the service as a parameter. The following is a screen capture of the fixed URL created by the Document ID service for the EvaluateSharePointServer2010-ITPro.docx document located in the Documents library from the previous demonstration:
The URL can be seen by hovering over the Document ID property of the document.
The following walk-through will show you how to create a hyperlink on the Home page of your team site to a document in the Shared Documents library. For the document's URL, we will use the Document ID service's path.
- Copy the Document ID link of the EvaluateSharePointServer2010-ITPro.docx document.
- Click the Shared Documents link in your site's Quick Launch menu.
- Click the ellipsis button to the right of the EvaluateSharePointServer2010-ITPro link than click the second ellipsis button on the balloon pop-up and choose the View Properties from the options menu.
- Right-click the Document ID property link and choose the Copy shortcut option.

- Create a hyperlink on the Home page of your site that uses the Document ID URL to the EvaluateSharePointServer2010-ITPro.docx document.
- Navigate back to the home page of your site.
- Click the Edit link at the top of the page to edit the page.
- Place our insertion point at the bottom of the main middle content area.
- Click the Link button drop-down in the INSERT tab toolbar and choose the From Address option.
- Type "SharePoint 2010 ITPro Doc" in the Text to display field.
- Paste the copied URL form the Document ID property into the Address field.

- Click the OK button to save the hyperlink.
- Click the SAVE icon in the upper right of the page to save the changes.
- Click the link and verify it prompts you to open the EvaluateSharePointServer2010-ITPro.docx document.
- Cancel opening the document.
Tuesday, July 21, 2015
Creating a Folder in a SharePoint List and adding Items to it programatically
The following code is to create a folder in a SharePoint list and add items to it. This code is written for a Custom Visual Studio Workflow, the workflow will be started when a new item is added to a list.
public Guid workflowId = default(System.Guid);
public SPWorkflowActivationProperties workflowProperties = new SPWorkflowActivationProperties();
SPList list = null;
SPListItem folderItem = null;
private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
{
SPListCollection listCollection = workflowProperties.Web.Lists;
//Creating folder in "MyContacts" Lists
list = listCollection["MyContacts"];
// create a folder under the path specified
folderItem = list.Items.Add(list.RootFolder.ServerRelativeUrl, SPFileSystemObjectType.Folder);
// set the folder name and update
folderItem["Title"] = "My Folder"
folderItem.Update();
//create a listitem object to add item in the foler
SPListItem listItem = list.Items.Add(folderItem.Folder.ServerRelativeUrl, SPFileSystemObjectType.File, null);
//Set the values for other fields in the list
listItem["Contact ID"] = workflowProperties.Item["Contact ID"];
listItem["Contact Name"] = workflowProperties.Item["Contact ID"];
listItem.Update();
workflowProperties.Item.Update();
oWeb.AllowUnsafeUpdates = false;
}
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin Microsoft.SharePoint.PowerShell
}
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("microsoft.sharepoint.portal")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("System.Web")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy.dll")
$site = Get-SPSite -Identity $siteurl -ErrorAction Stop
$ctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ctx)
$upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($ctx)
foreach($property in $upm.Properties)
{
if($property.Name -eq "SPS-UserPrincipalName")
{
Write-Host $property.IsUserEditable
$property.IsUserEditable = $true;
$property.IsVisibleOnEditor = $false;
$property.IsVisibleOnViewer = $false;
$property.Commit();
}
}
if ((Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{
Add-PsSnapin Microsoft.SharePoint.PowerShell
}
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
[System.Reflection.Assembly]::LoadWithPartialName("microsoft.sharepoint.portal")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Reflection.Assembly]::LoadWithPartialName("System.Web")
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Taxonomy.dll")
$site = Get-SPSite -Identity $siteurl -ErrorAction Stop
$ctx = [Microsoft.Office.Server.ServerContext]::GetContext($site)
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($ctx)
$upcm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($ctx)
foreach($property in $upm.Properties)
{
if($property.Name -eq "SPS-UserPrincipalName")
{
Write-Host $property.IsUserEditable
$property.IsUserEditable = $true;
$property.IsVisibleOnEditor = $false;
$property.IsVisibleOnViewer = $false;
$property.Commit();
}
}
Wednesday, July 15, 2015
Hi,
SharePoint 2013 ..change the master page.
we can get this option at Look and Feel section of the site settings but the thing is..we must remember
pblishing features activated or not. two places we must activate one is web and site collection feautres. Also I would like bring ..Navigation link @look and feel section will come once the above features activation.
Another thing is default the site will have two level top navigation. If we want to change the Top Menu ..qwe must do changes the master page which has been used for site and proceeed.
Friday, July 10, 2015
https://kogzee.wordpress.com/2013/08/07/style-sharepoint-2013-top-navigation-global-navigation-menu/
http://www.nothingbutsharepoint.com/2013/04/25/yes-the-sharepoint-navigation-really-can-work-for-your-needs-aspx/
| How much room do I have to change the top navigation in SharePoint? I have a publishing site and I am using SharePoint's default top navigation which I have modified a little (by applying CSS) but now I want some more changes as below. Please check if this is possible to do or not? In my top navigation there are three levels: Main Link | ------Sub link 1 | | | -----------Sub link a | | | -----------Sub link b | ------Sub link 2 When you mouse over "Main Link" it opens level 1 which shows "Sub link1" and "Sub link2". When you mouse over "Sub link 1" then it shows level 2 "Sub link a" and "Sub link b". I want to show a different style bullet on level 1 and level 2. They are basically images (small icons) which will be displayed in level 1 and level2 with each item. But again the thing is, icon of level 1 is different than icon of level 2. Is this possible? EDIT I am using custom master page not the ones provided by SharePoint. |
| |
| I found this tutorial and looks like it is quite possible.http://kogzee.wordpress.com/2013/08/07/style-sharepoint-2013-top-navigation-global-navigation-menu/ EDIT The above article explains how you can integrate your custom menu with SharePoint in 2 easy steps. Suppose you have got the CSS and HTML of menu from designer and now as a SharePoint developer you want to integrate it. Here's how CSS and HTML file will look like: CSS The CSS is pretty large so I am only pasting small portion of it. You can see rest of it on the link above. /*Navigation*/
.crom-Navigation {
font-family:"Trebuchet MS", Helvetica, sans-serif;
margin: 10px 0px;
top: 0px;
position: relative;
z-index:200;
}
.crom-Navigation a {
margin: 0px;
padding: 0px;
border: 0px;
text-decoration:none;
}
.crom-Navigation ul {
list-style: none;
margin: 0px;
padding: 0px;
font-size: 16px;
z-index:200;
border-bottom: 2px solid #003f5f;
}
HTML <!--Menu-->
<div id="navigation" class="crom-Navigation">
<ul>
<li><a href="#">Cameras</a>
<ul>
<li><a href="#">Camcorders</a></li>
<li><a href="#">Digital cameras</a></li>
<li><a href="#">Disposable cameras</a></li>
<li><a href="#">Film cameras</a></li>
</ul>
</li>
<li><a href="#">Computers</a>
<ul>
<li><a href="#">Desktops</a></li>
<li><a href="#">Laptops</a></li>
<li><a href="#">Netbooks</a></li>
<li><a href="#">Tablets</a></li>
</ul>
</li>
<li><a href="#">Media</a>
<ul>
<li><a href="#">Movies</a></li>
<li><a href="#">Music</a></li>
<li><a href="#">TV shows </a></li>
<li><a href="#">Video games </a></li>
</ul>
</li>
</ul>
</div>
Now simply do the following steps and the menu will be displayed. Call that custom CSS in your master page <SharePoint:CssRegistration
name="<% $SPUrl:~sitecollection/_catalogs/masterpage/CromwellFixedWidth/CromwellFixedWidthStyle.css %>"
runat="server"
after="SharepointCssFile"/>
Copy/Paste following code in your master page where you want to display menu <!--Menu-->
<div id="navigation" class="crom-Navigation">
<!--Top Menu-->
<SharePoint:AjaxDelta id="DeltaTopNavigation" BlockElement="true" CssClass="ms-displayInline ms-core-navigation" role="navigation" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="TopNavigationDataSource" Id="topNavigationDelegate">
<Template_Controls>
<asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider"
id="topSiteMap"
runat="server"
StartingNodeUrl="sid:1002"/>
</Template_Controls>
</SharePoint:DelegateControl>
<asp:ContentPlaceHolder id="PlaceHolderTopNavBar" runat="server">
<SharePoint:AspMenu
runat="server" UseSeparateCss="false"
AdjustForShowStartingNode="False" StaticDisplayLevels="2"
AccessKey="1" SkipLinkText="" EnableViewState="False"
MaximumDynamicDisplayLevels="1"
DataSourceID="topSiteMap" Orientation="Horizontal"
RenderingMode="List"
UseSimpleRendering="False"
ID="TopNavigationMenu">
</SharePoint:AspMenu>
</asp:ContentPlaceHolder>
</SharePoint:AjaxDelta>
</div>
| | answered Dec 5 '13 at 11:32 |
|
Wednesday, July 8, 2015
http://sharepoint-community.net/profiles/blogs/sp2013-powershell-create-userprofile-taxonomy-based-property
-----------------------------------OR--------------------------------------------
param
(
# Site Url input parameter
[string]$SiteUrlParameter
)
try
{
$propertyNames = New-Object System.Collections.ArrayList
$propertyDisplayNames = New-Object System.Collections.ArrayList
$termSetNames = New-Object System.Collections.ArrayList
$siteUrl = "http://ABC:123"
if($SiteUrlParameter -ne $null)
{
$siteUrl = $SiteUrlParameter
}
# Add your Custom User Properties to the Arraylist below
#if you add term set name as NA, the correspoding property will be added as single line of text
$propertyNames.Add("UPS-ABC")
$propertyDisplayNames.Add("ABC")
$termSetNames.Add("ABC")
$propertyNames.Add("UPS-ABC")
$propertyDisplayNames.Add("ABC")
$termSetNames.Add("ABC")
$propertyNames.Add("UPS-ABC")
$propertyDisplayNames.Add("ABC")
$termSetNames.Add("ABC")
$propertyNames.Add("UPS-ABC")
$propertyDisplayNames.Add("ABC")
$termSetNames.Add("ABC")
$propertyNames.Add("UPS-ABC")
$propertyDisplayNames.Add("ABC")
$termSetNames.Add("ABC")
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
[System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server")
[System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")
[System.Void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles.UserProfileManager")
$site = Get-SPSite $siteUrl
$serviceContext = Get-SPServiceContext $site
$upConfigMgr = New-Object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)
$coreProperties = $upConfigMgr.ProfilePropertyManager.GetCoreProperties()
$taxonomySession = Get-SPTaxonomySession -Site $site
$loopcount = 0
foreach($propertyName in $propertyNames)
{
$propertyDisplayName = $propertyDisplayNames[$loopcount]
$termSetName = $termSetNames[$loopcount]
if($coreProperties.GetPropertyByName($propertyName) -ne $null)
{
Write-Host "Property Already exists, deleting" $propertyName
$coreProperties.RemovePropertyByName($propertyName)
}
$upcoreproperty = $coreProperties.Create($false)
$upcoreproperty.Name = $propertyName
$upcoreproperty.DisplayName = $propertyDisplayName
if($termSetName -ne "NA")
{
$upcoreproperty.Type = [Microsoft.Office.Server.UserProfiles.PropertyDataType]::StringMultiValue
$upcoreproperty.IsMultivalued = $true
$mytermSet = $taxonomySession.GetTermSets($termSetName,1033)
$upcoreproperty.TermSet = $mytermSet[0]
}
else
{
$upcoreproperty.Type = [Microsoft.Office.Server.UserProfiles.PropertyDataType]::StringSingleValue
$upcoreproperty.IsMultivalued = $false
$upcoreproperty.Length = 100
}
$upcoreproperty.Description = "This Property Value is populated by a Timer Job"
$upcoreproperty.IsSearchable = $true
$coreProperties.Add($upcoreproperty)
$userProfilePropertyManager = $upConfigMgr.ProfilePropertyManager
$userProfileTypeProperties = $userProfilePropertyManager.GetProfileTypeProperties([Microsoft.Office.Server.UserProfiles.ProfileType]::User)
$userProfileProperty = $userProfileTypeProperties.Create($upcoreproperty)
$userProfileProperty.IsVisibleOnEditor = $false
$userProfileProperty.IsVisibleOnViewer = $true
$userProfileTypeProperties.Add($userProfileProperty)
$upSubTypeManager = [Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::Get($serviceContext)
$userProfile = $upSubTypeManager.GetProfileSubtype([Microsoft.Office.Server.UserProfiles.ProfileSubtypeManager]::GetDefaultProfileName([Microsoft.Office.Server.UserProfiles.ProfileType]::User))
$userProfileProperties = $userProfile.Properties
$userProfileSubProperty = $userProfileProperties.Create($userProfileProperty)
$userProfileSubProperty.DefaultPrivacy = [Microsoft.Office.Server.UserProfiles.Privacy]::Public
$userProfileSubProperty.PrivacyPolicy = [Microsoft.Office.Server.UserProfiles.PrivacyPolicy]::OptIn
$userProfileSubProperty.IsUserEditable = $false
$userProfileSubProperty.UserOverridePrivacy = $false
$userProfileProperties.Add($userProfileSubProperty)
$userProfileProperty.CoreProperty.Commit()
$userProfileProperty.Commit()
$userProfileSubProperty.Commit()
Write-Host "Propert Created InternalName" $propertyName " Display Name " $propertyDisplayName " Mapped to Termset " $termSetName
$loopcount = $loopcount+1
}
}
catch
{
Write-Error "Error Creating Profile properites, check error details."
Write-Error $_.message
}