Monday, June 20, 2011

Some of the best practices..

Some of the best practices are:

1. You should always dispose SPsite and SPWeb objects, once you refer them in your code. Using the “Using” clause is recommended.

2. Use RunwithelevatePrivilages to avoid errors for end users.

3. Try writing your errors to SharePoint error logs (ULS Logs). Since it’s a bad idea to fill-up event log for your production environment.

4. Use SPQuery instead of foreach loop while retrieving Items from the list.

5. Deploy additional files used in your webpart to 12 hive. Use your solution package to drop the files in 12 hive. Also, make sure that all the references (for e.g. Css or .js files) get removed when the solution is retracted.

Tuesday, May 31, 2011

Phonetic First Name deleted

http://social.technet.microsoft.com/Forums/en/sharepoint2010setup/thread/20c4c8e1-21ca-40ea-9f25-1c306b70630f

http://bramdejager.wordpress.com/author/bramdejager/

Phonetic First Name
SPS-PhoneticFirstName
msDS-PhoneticFirstName

• UPDATE PropertyList SET PropertyName='SPS-Location' WHERE PropertyName='SPSLocation';


• SELECT * FROM PropertyList WHERE PropertyName='SPSLocation';
• UPDATE PropertyList SET PropertyName='SPS-Location' WHERE PropertyName='SPSLocation';

Mapping Attributes missing from the “Attributes” drop down

In certain cases, the attribute that you are trying to map may not be visible in the attributes drop down on the user profile property creation page. In this case, you will need to use PowerShell to map the LDAP attribute to SharePoint profile property. In order to run the script successfully, pleas ensure the following:

You know the name (not Display Name) of the SharePoint Profile Property to which you need to map the attribute
You know the name of the LDAP attribute that you wish to map (case sensitive)
You are logged in as the farm account (the account under which the timer service and central administration application pool is running)
The user profile service application where you need to perform the mapping should be the default service application associated to the central administration web site. Here is how you can verify this:
From central administration, click on “Application Management” on the left navigation bar
Click on “Manage Web Applications”
Select “SharePoint Central Administration v4”
From the Ribbon menu, click on “Service Connections”

Verify that from the list of connections, the user profile service application that you are performing the mapping for is checked and is set as the default service connection.


If the user profile service application proxy where you are performing the mapping is not set as default, please select “custom” as the service connection group and then choose the user profile service application connection that you are working with to perform the mapping.
After you have verified the above, please run the following script to perform the property mapping. Set the value of $url to the url of the central administration web site. Update the values of $spsProperty, $fimProperty and $connectionName to match your environment. Note that the direction of this mapping will be “Import”.

$url = "http://tehnoonr-ws08-4:1125" #URL of any site collection that is associated to the user profile service application.
$spsProperty = "EID" #Internal name of the SharePoint user profile property
$fimProperty = "employeeNumber" #Name of the attribute in FIM/LDAP source
$connectionName = "sun" #Name of the SharePoint synchronization connection

$site = Get-SPSite $url

if ($site)
{Write-Host "Successfully obtained site reference!"}
else
{Write-Host "Failed to obtain site reference"}

$serviceContext = Get-SPServiceContext($site)

if ($serviceContext)
{Write-Host "Successfully obtained service context!"}
else
{Write-Host "Failed to obtain service context"}
$upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)

if ($upManager)
{Write-Host "Successfully obtained user profile manager!"}
else
{Write-Host "Failed to obtain user profile manager"}
$synchConnection = $upManager.ConnectionManager[$connectionName]

if ($synchConnection)
{Write-Host "Successfully obtained synchronization connection!"}
else
{Write-Host "Failed to obtain user synchronization connection!"}

Write-Host "Adding the attribute mapping..."
$synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
Write-Host "Done!"


Perform a full synchronization after the mapping has been created.

Hope this has been helpful!

Happy SharePointing!

Export/Import of SharePoint 2010 site using Power Shell

In this article I am showing you how to perform Import/Export operation of a particular SharePoint site using Power Shell

1. On the Start menu, click All Programs.

2. Click Microsoft SharePoint 2010 Products.

3. Click SharePoint 2010 Management Shell.

4. At the Windows Power Shell command prompt type the following command:



5. You will get a Power shell command prompt like below



6. In SharePoint 2010, Power Shell command Export-SPWeb is used to export the site

7. Please see the screen shot for the Power Shell command

8. Export-SPWeb -Identity http:\\ServerName:port\Site -Path c:\\backup\Exportback.dat



9. The NoFileCompression parameter lets you specify that no file compression is performed during the export process. Using this parameter can lower resource usage up to 30% during the export process. Using this parameter will result in a backup folder being created instead of a compressed file. If you use the NoFileCompression parameter in the Export-SPWeb command, you must also use it when you import the content by using the Import-SPWeb command.

10. To import to a site you have to use Import-SPWeb command

11. The complete command is

12. Import-SPWeb -Identity http:\\ServerName:port\Site -Path c:\\backup\Exportback.dat -Force

13. I have used -force to over write the existing site in my destination

Thursday, May 26, 2011

"You must specify a value for this required field” error in custom master page SP 2010

When customizing SharePoint 2010 MasterPages you often don’t want certain content placeholders to show up on the page. You should not delete or comment these elements out but instead set the visible=”false” attribute on the content placeholder. Upon creating a custom MasterPage tonight I found that most of the placeholders hide just fine with the visible=”false” setting; however, I have found a bad side effect of one of them.

If you set the PlaceHolderPageTitleInTitleArea’s content placeholder to visible=”false” within the MasterPage it will save just fine and also render as expected. The problem presents itself when you edit a page that is using this MasterPage. Upon saving the page back to SharePoint you will receive an error stating “You must specify a value for this required field” and the save will fail.

The alternate way to hide this content placeholder is to create a simple CSS class containing “visibility:hidden” and referencing this class with the CssClass attribute of a new asp:panel element that contains your content placeholder. You can hide the others in the same way as well and if you want to hide a whole group of them this may be a good way to get them all in one sweep.

Create a simple CSS class as shown below:
.hiddenpanel
{
visibility:hidden;
}


Use it to on an asp:panel to hide your content placeholder(s):




Other content placeholder's in the v4.master MasterPage to be aware of:
PlaceHolderPageTitle
PlaceHolderAdditionalPageHead
PlaceHolderBodyAreaClass
PlaceHolderTitleAreaClass
PlaceHolderGlobalNavigation
PlaceHolderTitleBreadcrumb
PlaceHolderGlobalNavigationSiteMap
PlaceHolderSiteName
PlaceHolderPageTitleInTitleArea
PlaceHolderPageDescription
PlaceHolderSearchArea
PlaceHolderTopNavBar
PlaceHolderHorizontalNav
PlaceHolderLeftNavBarDataSource
PlaceHolderCalendarNavigator
PlaceHolderLeftActions
PlaceHolderLeftNavBarTop
PlaceHolderLeftNavBar
PlaceHolderQuickLaunchTop
PlaceHolderQuickLaunchBottom
PlaceHolderQuickLaunchBottomV3
PlaceHolderQuickLaunchBottomV4
PlaceHolderPageImage
PlaceHolderTitleLeftBorder
PlaceHolderMiniConsole
PlaceHolderTitleRightMargin
PlaceHolderTitleAreaSeparator
PlaceHolderNavSpacer
PlaceHolderLeftNavBarBorder
PlaceHolderBodyLeftBorder
PlaceHolderMain
PlaceHolderBodyRightMargin
PlaceHolderFormDigest
PlaceHolderUtilityContent
SPNavigation
WSSDesignConsole

Tuesday, May 17, 2011

InfoPath 2010\Infopath is not working for sharepoint designer workflow.

Hello All,

I got some really good news, in my opinion. I’ve found a pretty easy way to keep the original aspx page in the loop while still upgrading your workflow. You’re going to have to set the content type of the form each time though but so far has worked very well in my testing.

I’ll start with the basic workflow I created and what I’ve been doing for the last day or so.

1. In 2007 create a workflow that has 9 lookup columns in a collect feedback from user action.
2. Have the workflow start when a new item is created.
3. Publish the workflow and make sure it completes.
4. If all is good backup the 2007 database in SQL.
5. Restore the database to a new database.
a. I’m on the latest build of 2007 and 2010 (April CU)
6. Now, what is supposed to happen, if you don’t touch the SPD 2007 workflows, is you should be able to use your 2007 workflows without any issues. You should be able to keep using your aspx page and life should be good.
a. This is not what happens. I’m not sure if this is because of a regression or if it’s never worked. I want to say I recall testing this during beta and at RTM and it works.
b. What happens is if you try to complete a task you’ll get the following error in ULS and in the browser:

05/11/2011 18:28:37.53 w3wp.exe (0x13F4) 0x0F24 SharePoint Foundation Runtime tkau
Unexpected System.Runtime.InteropServices.COMException: Cannot complete this action. Please try again.
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView)
at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView)

c. I tried to open the aspx page to see if the DataFormWebPart was broken or what was going on but it would never allow me to return any of the fields. Very odd stuff. On the task list I could not get an SPListItemCollection or anything.
d. So, I captured a dmp file and took a look inside of it and it gave me a better callstack.
e. I found that we’re trying to make the following CAML query happen but keep getting an error:
f. 2
g. Very simple query that should return an collection of items or since we’re providing an ID value a single item.
h. I confirmed this fails with web services using U2U caml query builder for SharePoint.
7. With that knowledge under my belt I went in and modified each of the site columns that are part of this workflow. I should say, the site columns that the collect feedback action created.
8. All I did is click on each column as if I were going to modify them and just clicked ok.
9. The SchemaXml changes as follows:



to:



We add this to each lookup column:

Required="FALSE" EnforceUniqueValues="FALSE" Group="Custom Columns" UnlimitedLengthInDocumentLibrary="FALSE" Version="1"

10. This seems to fix the issue. There seems to be some sort of issue with the upgrade where we don’t upgrade these columns correctly.
11. Now, I can complete my task list items like I thought I was supposed to. I’m not 100 sure if this is limited to lookup columns.
12. Next, I could finally move onto the part where I figured out the workaround. I’ll have that be a separate section below this write-up.

To summarize, with the steps above you should be able to keep all your columns and workflows as is and they should just keep working.


This section is my workaround explanation for keeping the aspx page in play after upgrading the workflow.

1. Now, we’re ready to upgrade your workflow. When you open the workflow in SPD 2010 and click publish you’ll get a warning that indicates we’re going to be upgrading your workflow to an XSN based forms. You have to acknowledge it and then you can click publish or add actions to your workflow..
2. If you do so and have some of the unsupported columns, in this given scenario: lookups, calculated, extended and page breaker, the InfoPath xsn generation will indicate an error. That’s fine, we don’t care about this xsn based form. Let SPD try to auto generate this form.
3. Once click Lists and Libraries.
4. Click Tasks, usually the default task list for SPD 2007 workflows.
5. Find your content type, in the content type slab, that was created by the collect data form user action.
6. Take note of the forms urls for display and edit.
a. They should be something like this: _layouts/WrkTaskIP.aspx
b. Change the edit form to the path of your aspx page. It won’t be visible if you click the workflows in the site objects but should be visible via the All files site object.
c. In my example I had to change the edit form to /Workflows/myWorkflow/customEditForm.aspx.
7. Save the content type at that list level.
8. Now, you should be able to complete your tasks using the aspx page and the original form. The xsn file is just ignored.
a. If you have custom email notification like you have then just make sure to keep pointing those to the aspx page.
9. The only downside is that if you update this workflow you’ll need to remember to change the content type on that task list to use your aspx page.

Monday, May 16, 2011

Custom site templates issues in 2010 after migration

1. Install and configure SharePoint 2010 per the instructions at http://technet.microsoft.com/en-us/library/cc262243.aspx.
2. Create a web application per the instructions at http://technet.microsoft.com/en-us/library/cc288705.aspx. Enter the following. Default for all others is fine.
a. Name: SharePoint
b. Port: 80
c. Host Header: Leave this blank.
3. Create a site collection per the instructions at http://technet.microsoft.com/en-us/library/cc263165.aspx. Use the following settings:
a. Title: Test Publishing Site
b. Web Site Address: http:///
c. Template: Publishing
4. Upload the logo and .css to the Style Library of the site.
a. Site Actions > View all site content > click the Style Library.
b. Upload a .CSS style sheet.
d. Return to the Style Library and click the Images folder.
e. Upload a .JPG to the images folder.
5. Link a custom Style Sheet to the Publishing site, then change to the v4 master.
- In the Alternate CSS URL section, click to 'Specify a CSS file to be used by this publishing sites and all sites that inherit from it'.
- Browse to the .CSS in the Style Library.
- Now toggle the masterpage to V4 masterpage in both Site Master Page and System Master Page.
- Click OK.
6. Create a new site under the publishing root site using a Team Site template.
7. Return to the root Publishing site. In Site Settings, click Master page.
- Select the check-box stating 'Reset all subsites to inherit this alternate CSS URL'
Then click OK.
8. Set the Site Logo on the Team Site
-Site Actions > Site Settings > Click Title, description, and icon.
- In the 'Logo URL and Description' give the full URL to the logo's .jpg file. Click to test using 'Click here to test'. Click OK.
9. Save the Team Site as a template
Click Site Actions > Site Settings > Save site as template. Save this site as a template; this will place that template in the solution gallery
(http:///_catalogs/solutions/forms/allitems.aspx).
10. Create a new site using the .wsp 'Template'
- This is done through Site Actions > View All Site Content > Create. Select your template by name in the Silverlight Create dialog > Name and
create the site.
11. Once this new site is created, try to go to Site Settings here.
Also notice that the site logo is not set.

Actual Results:
The Site Logo is missing and Site Settings is not accessible

Error Message in Browser Unexpected Error

ULS
System.Web.HttpException: Error executing child request for /Style Library/XSL Style Sheets/ModotCustomStyles.css.
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
at ASP._controltemplates_topnavbar_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The workaround for this, if you're having this issue is to run the following PowerShell or object model code to make that property empty:

$web = Get-SPWeb http://
$web.AlternateHeader
<< will show the url of the AlternativeCSS >>
$web.AlternateHeader = ""
$web.Update()

This would have to be integrated into your wsp creation code. It would need to set the property to an empty string after the process of creating the wsp has finished. I'm not familiar with that API but this is what you do to fix this issue up post site creation so the key would be to see if you can modify the wsp in your code to avoid this altogether.

SharePoint 2010 MySite in detail

In generalThe SharePoint 2010 MySite has changed in major points to the one in SharePoint 2007. The most striking renewals are probably the tagging und activity features. The user can now tag, comment and rate his sites and documents.

Since SharePoint 2010 has no longer a Shared Service Provider the MySite is now bound to the Profile Service. This means that the profile service must be running and configured before you can create a MySite.

The MySite uses a special master page, the "mysite.master", which is activated by the feature MySiteLayouts and uploaded to the master page gallery of the MySite sitecollection. It's relatively easy to change and switch the masterpage either by hand or by feature. The sitecollection administrator can upload a masterpage to the masterpage gallery and easily switch the master.

The good news for the frontend engineer is that the new mysite.master consists mostly of div layouts, so it
is easier to style by css. But in generally it is more difficult to change the layouts than the masterpage. This is because the mysite is a team site and has no publishing features. But you can easily change that by activating
the publishing features by hand.

The easiest way to style the mysite is propably by using themes. The sitecollection admin can create his own themes or use the existing ones.

Structure
The MySite has public and private spheres. The public pages use a different site template as the personal pages


Public : SPSMSITEHOST (My Site Host)
Private : SPSPERS (SharePoint Portal Server Personal Space)

Once you click on "My Site" within the Site Actions menu, it leads to the public area, to the default.aspx MySite site collection.





Public areas have the same view for each user and can not be personalized. All users from the ProfilDB have access to this area and only the site collection administrators can customize these pages and web parts.

The public area includes the following page:
default.aspx
discusssion.aspx
person.aspx
OrganizationView.aspx
personcontent.aspx
tagprofile.aspx

The HTML structure of these pages cannot be modified by deployment. The layout of these pages can be adjusted only with CSS, Themes or SharePoint Designer.

Clicking on "My Profile" (Site Actions Menu) leads to the public profile page. This page displays the profile information of the selected users. If the user wants to see his own profile, he has the rights to change the stored profile information. The changes are written back to the Profile-DB. If a synchronization is configured with an AD the information could also be written back to the AD.

By clicking on "My Content" in the MySIte global navigation the user enters his private area. His personal site is a site within the MySite sitecollection. If it does not exist it is created the first time. A user can create lists, modifiy content and add webparts to his personal page. It is used as a private storage of documents and information.

A private site has the url http://mysite.com/personal/mkaplan. "Personal" ist the managed path of the sitecollection and "mkaplan" the accountname and the sitecollection.

Looking at the global navigation, you'll realize that the MySite is logically divided into 3 parts. These are:


My NewsFeed: Area for actual news from colleagues
My Content: Area for personal data
My Profile: Area with profile information of the MySite users

The following sections will describe these parts.

Lists on MySiteHost
The root site has following lists predefined:

List Name Description
Customized Reports For Web Analytics
Form Templates Contains the form templates
Style Library For custom stylessheets
Organization Photos Organization logos
User Photos Profile pictures

Personalization Sites
You can also use personalized sites witin the public areas of the MySite. This requires to create a new site using the "Personalization Site" template.


Personalization site template

"Personalization Sites" use the "Current User Filter" webpart, which can be connected with other webparts to display personalized data.

When you create a "Personalization Site" in the MySite the site will appear within the global navigation of the MySite as an extra entry, which is available for all users. A "Personalzation Site" contains 4 webpart zones: 1 on the top, 1 at the bottom and 2 in the middle.


A personalization site

Personalization Links in the global navigation
"Personalization Links" can be created to show entries in the global navigation for a specific audience. These types of links must be created in the "Profile Service Properties" und "Configure Personalization Site".



--------------------------------------------------------------------------------

Site Definitions within the MySite


1. SPSMYSITEHOST

The SPSMYSITEHOST Teamsite Sitedefinition is used for all public sites within the MySite. It activates following features:

Site Features:

"My Site Host" in FEATURES\MySiteHost\Feature.xml.
"My Site Layouts" in FEATURES\MySiteLayouts\feature.xml.
Web Features:

"My Site Navigation" in FEATURES\MySiteNavigation\Feature.xml.
"Shared Picture Library for Organizations logos" in FEATURES\MySiteHostPictureLibrary\Feature.xml.
"Team Collaboration Lists" in \FEATURES\TeamCollab\feature.xml.
Modules: (deployed files)

blog.xsl : Is used by the blog webpart
tagprofile.aspx
person.aspx
default.aspx
discussion.aspx
OrganizationView.aspx
personcontent.aspx

2. SPSPERS
This Sitedefinition is used by the private sites on the MySite and activates the following features:

Adds following items to the Quicklaunch menu:

Documents
Pictures
Libraries
Site Features:

My Site Layouts: Deploys mysite master and pages
Base WebPart Feature
Web Features:

‘Personalization Site’ in FEATURES\PersonalizationSite\feature.xml.
‘My Site Navigation’ in FEATURES\MySiteNavigation\Feature.xml.
‘Team Collaboration Lists’ in FEATURES\TeamCollab\feature.xml.
Modules:

public.aspx: Contains a redirect webpart
default.aspx
WebParts :

none
Lists:

Personal Documents
My Documents
My Pictures


--------------------------------------------------------------------------------

Globally used elements


MySite Header

The MySite Header consists of different items: (Color corresponds to the item in image)


Page Title / Icon : A simple HTML element
Global Navigation: The navigation of the MySite is editable by the site owner in the "Site Settings", "Top Link Bar".
Searchbox: The Searchbox is a SharePoint PeopleSearchEx Control and has properties to change the search icon, scope dropdown, frametyp or the search options.
HelpButton: A simple HTML element
MySite Menu: Can optically only be changed by styles. Menu items can be changed by feature.



MySite Header

The MySite-Header is found on every site within the MySite, in public as well as in private sites. It is bound as a Delegate Control into the mysite.master und can be found as a ascx Control in the 14\ControlTemplates folder. The name of the file is "MySiteTopNavigation". Delegate Controls in SharePoint have the ability to be easily overriden by custom controls. This means that the header of a mysite could be customized with a custom ascx control and a feature.


Business Card
Some of the public pages contain a larger area with profile informations about the user, that is called the "Business Card“. Users can see profile informations about other users and can also enter or change personal status information, like in Twitter or Facebook. There are also standard texts for the status information, which can be choosen by a dropdown. If you examine your own "Business Card" you'll find also a link under the profile picture to edit the own profile informations.


MySite Business Card

The "Business Card" is not a Control itself but a combination of HTML tables and profile informations. The profile informations are read by special profile property controls, like the departement field:





This means that each page containing the "Business Card" must have the same HTML code. If someone changes the layout of the Business Card with Sharepoint Designer, he must change it on every site that contains the "Business Card" to have a consistent layout.


Quicklaunch
You'll find the "Quicklaunch Navigation" directly under the "Business Card". It is embedded to the page (not master) as an ASP:Menu Control and renders an unordered list as HTML Code and styled by css to look like that:


MySite Quicklaunch

The menu navigation points can be changed within the "Site Properties" by clicking the "Quicklaunch" link under "Look and Feel". Each of the default navigation items is linked to a different aspx page:

"Overview" is linked with person.aspx.
"Organization" is linked with organizationview.aspx.
"Content" is linked with auf personcontent.aspx.
"Tags and Notes" is linked with _layouts/thoughts.aspx.
"Colleagues" is linked with _layouts/MyContactLinks.aspx.
"Memberships" is linked with _layouts/MyMemberships.aspx.
The first 3 pages are delivered with the MySite Feature whereas the last 3 are pages in the layouts folder. All these page are not really personalized. Therefore there need a parameter in the url to display custom content.


--------------------------------------------------------------------------------

Detailed inspection of MySite pages

My Newsfeed - Default.aspx

The newsfeed (or activity feed) is a new feature in SharePoint 2010. This feature corresponds to the concept of news streams in facebook. It shows the latest activities of colleagues such as new tag, changed profile information or new blog posts. The page uses the "ConsolidatedNewsFeedWebPart" to show the information.

The activity feed

Tagprofile.aspx


The tagprofile.aspx page shows information about a tag. The page is displayed when you open the "Tags & Notes" site in the quicklaunch menu and then click a tag in this site. The page contains following webparts:

"TagInformationWebPart" - Shows information about a tag.
"TaggedUrlListWebPart" - Shows tagged items.
"TaggedPeopleListWebPart" - Shows people that follow a tag
"SocialCommentWebPart" - Provides a note board

Tag information site

My Profile - Person.aspx

You get to the person.aspx when you click "My Profile" in the quicklaunch menu. This page provides an overview of general information and activities of a user.

The upper area of the site contains the "Business Card" and the "Quicklaunch Navigation". They are followed by the page content. The page layout has 4 webpart zones, like in the personal sites. The page has 1 zone in the upper, 2 in the middle and 1 at the bottom area to guarantee a flexible layout. To be flexible with webpart content, the webpart zones are located within a table layout. It is difficult to make cross browser flexible layouts only with divs.

The page contains 5 predefined webparts:


Ask Me About : Reads the "Ask Me About" field from the profile und displays it as a list. Informs other user about the skills of the selected user.
Recent Activities : Shows the recent activities of the current users, like the colleagues he added or a post he published.
Note Board : A textbox to post a comment.
Organigramm : Show the organizational structure and your position therein.
In Common With You : Shows common memberships and colleagues with other users.

Add Multiline Rich Text/Enhanced Rich Text column to document library or picture library

As you might have noticed the by default multiline column type doesn’t support Rich Text or Enhanced Rich text capability for a document/picture library.

There are multiple way to get this feature enabled. First is changing the SQL table for that column which is quick but not recommended and second one is a few step solution which works great without breaking any Microsoft rules.
Lets get started with the steps.
Step 1 – Create a new Site Column
To create a new multiline rich text column, click on Site Actions > Site Settings > Site Columns, then click on Create to add new site column:

Under “Additional Custom Settings”, you can select Rich text or Enhanced rich text option.
Step 2 – Create custom content type
Now we got the rich text site column, next step is to create a custom content type and add this column to it. To do that, click on Site Actions > Site Settings > Site Content Types, then click on Create link to add new content type:

You can give it any name and select the parent content type, for example “Document Content Type” and “Document”.
Click OK to save it.
Step 3 – Add custom site column to content type
Add the custom site column we created “RichtextColumn” to this content type:

Step 4 – Create document library with custom content type
Create a new dummy document library and go to Library Settings > Advanced Settings. Under first section “Content Types”, select “Yes” for “Allow management of content types?”.
Add custom content type we created to this library:

After this step you’ll see two content types for this document library. You can delete the default content type “Document” and just keep the custom one.:

after deletion:

Step 5 – Save custom document library as template
Next step is to save this custom document library as template so we can create the actual document libraries with rich text column. Under Library Settings, click on “Save document library as template”

Step 6 – Create document library from new template
Now we have created a new document library template, option will appear under “Site Actions > More Options” to create a new library based off that template:

step 7 – Add document to the library
Once the new document library is create based off new template, try adding a new document to this library and notice the rich text box column:

You can use similar steps to add custom rich text columns to picture library.
Hope this helps.

Compare the folders in the SharePoint WFE servers..

http://scootersoftware.com/ -- to compare the folders in the server..

Need to copy 14 hive folders from the server to client machine.. and compare

_spbodyonloadfunctionnames is undefined Javascript Error in sharepoint

Generally, ASP.NET 2.0 Master page concept is used for sharepoint pages and the “body ” is defined in master page. So, the content page is not able to add function to the body’s onload event directly. In order to work around this limitation, SharePoint provides the “_spBodyOnLoadFunctionNames” array. When the body is loaded, the onload event handler executes each function whose Name is contained in this array. We added “myFunction” to the array so that it would run when the body’s onload event fires.
_spBodyOnLoadFunctionNames.push("myFunction ");
To fix the javascript error: View source of sharepoint page from browser.
1. Make sure in the head tag, init.js is included.


2. Body onload is properly defined.


If these are not defined then it causes javascript error.
Hope, It helps.

Friday, April 29, 2011

SharePoint Search Error “Access is Denied”

If you are like me and did a single box farm installation of SharePoint 2010, you might get to an error whenever you have configured your search.

I configured the search to crawl my local SharePoint Sites and when it did a full crawl it gave me the following error:

Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify that the account you are using has “Full Read” permissions on the SharePoint Web Application being crawled.


This error is caused by the local loopback check.

You can disable the loopback check by setting the DisableLoopbackCheckregistry key. To set the DisableLoopbackCheck registry key, follow these steps

Click Start,
click Run, type regedit, and then click OK.
In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa

Right-click Lsa, point to New, and then click DWORD Value.
Type DisableLoopbackCheck, and then press ENTER.
Right-click DisableLoopbackCheck, and then click Modify.
In the Value data box, type 1, and then click OK.
Quit Registry Editor, and then restart your computer.
You can now also browse your site on your local server

People search not working in sharepoint 2010

I found the problem and everything is fine now. Since we are running Http://mysite.company.com I had to also crawl sps3://mysite.company.com. Then did a full crawl and worked like a charm. Thanks for all the help though!!

Time to go back to Central Administration, and first look at your Search service application's management page. Click the Content Sources link on the left hand side, and open/edit your Local SharePoint Sites content source. In the Start Addresses section, you will see a box with entries similar to those below:

Notice the sps3: line. This is the protocol SharePoint uses to read profiles. (Note: It isn't a "protocol", per se. It just instructs SharePoint to call a specific web service hosted at that address.) If you ran the wizard to configure your service applications, it will be pointing at the original web application created by it. You'll need to change it to reflect your new profile web application, then save the changes to your content source definition. Also, if you deleted the original wizard-created web application (or aborted its creation), you'll need to delete the regular http: line referencing it.

Property doesn't exist or is used in a manner inconsistent with schema settings in sharepoint 2010

While performing people search in SharePoint 2010 we encounter following error

Property doesn't exist or is used in a manner inconsistent with schema settings

Resolution:
-----------------

1. Browse the Search Center Site and perform people search which should take us to peopleresults.aspx page
2. Click on Site Actions à Edit Page
3. Edit People Search Core Web part
4. Expand Display properties and check the box against Use Local Virtualization
5. Click on Save and Close on the Ribbon

Try to perform people search again and you should get results back.

Thursday, April 28, 2011

webparts that have title issue after Migrating to 2010

If pages is checked out before migration, the webparts on that pages will migrate without titles.

Solution: Do the check in the home pages before/after migration.

Try to find a checked out pages with sql query to find in teh content DB.

Attachment not working for Edit Custom List form

Actually this is possible, but there is a procedure to following to make it
work. I had the same issue (working through it right now with MS support).
Here is a summary of the procedure...

Your Sharepoint environment must be at SP2 (actually infrasture update after SP1
is all you need, but SP2 is a better plan IMO), also you must upgrade to
Sharepoint Designer SP2.

In Designer open the NewForm.aspx of the list. Next, right-click on the
ListFormWebPart and select Web Part Properties. Select to Hide and Close the
web part.
Under the closed ListFormWebPart, create some space and add a custom List Form.
Make your customizations to the Custom list Form.

Apparently the DataFormWebPart, which is the "Custom List Form" does not add
everything to the page to support attachments. But by closing and hiding the
ListFormWebPart, whatever scripting that is needed by the attachment field is
added to the page and is available to the Custom List Form.

I have not found a good tutorial about this on the web, maybe someone can put
that together...

Friday, February 25, 2011

SharePoint 2010 Migration process

Attach a content database to a Web application
When you attach a content database, make sure that the root site for the Web application is included in the first content database that you attach. In other words, before you continue, examine the root of the Web application in the original server farm to determine the first site collection. After you attach the database that contains the root site, you can attach the other content databases for the Web application in any order. You do not have to create any site collections to store the content before you attach the database; this process creates the site collections for you. Make sure that you do not add any new site collections until you have restored all the content databases.

Important:
If you are moving the content databases across domains or forests or into another environment that has different service accounts, ensure that the permissions for the service accounts are still correct before you attach the databases.



You can use either the Mount-SPContentDatabase cmdlet in Windows PowerShell or the addcontentdb Stsadm command to attach a content database to a Web application. Using the SharePoint Central Administration pages to attach a content database is not supported for upgrading.

Ensure that the account you use to attach the databases is a member of the db_owner fixed database role for the content databases that you want to upgrade.

Important:
If you were using forms-based authentication, you will need to configure claims-based authentication for your Web application before you attach any databases. You must also create a policy to grant Full Control to the Web application to the user account that will be performing the database attach upgrade.

For more information, see Configure forms-based authentication for a claims-based Web application (SharePoint Server 2010).


Tip:
You cannot attach the same content database more than once to a farm, even on different Web applications. Each site collection in a content database has a GUID that is associated with it, which is registered in the configuration database. Therefore, you cannot add the same site collection twice to the farm, even in separate Web applications. Although you can successfully attach the database in this situation, you will be unable to start the site collection.

If you need a duplicate copy of a site collection in the same farm, first attach the database that contains the site collection to a separate farm, and then use the Stsadm backup and restore operations to copy the site collection over to the other farm. The Stsadm backup and restore process creates a new GUID for the site collection.



To attach a content database to a Web application by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

At the Windows PowerShell command prompt, type the following command:

Copy Code
Mount-SPContentDatabase -Name -DatabaseServer -WebApplication [-Updateuserexperience]
Where:

is the name of the database you want to upgrade.


is server on which the database is stored.


is the URL for the Web application that will host the sites.


Updateuserexperience is the choice to update to the new user experience or stay in the old user experience (part of Visual Upgrade). When you include this parameter, the site is set to preview the new user experience. Omit this parameter if you want the site to remain in the old user experience after upgrade. For more information, see Plan visual upgrade (SharePoint Server 2010).


For more information, see Mount-SPContentDatabase.

Note:
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.



To attach a content database to a Web application by using the Stsadm command-line tool
On the drive on which SharePoint Products and Technologies is installed, change to the following directory: %COMMONPROGRAMFILES%\Microsoft shared\Web server extensions\12\Bin.

Type the following command, and then press ENTER:

stsadm -o addcontentdb -url -databasename

[-databaseserver ] [-databaseuser ]

[-databasepassword ] [-sitewarning ]

[-preserveolduserexperience true/false ]

[-sitemax ]

[-assignnewdatabaseid] [-clearchangelog]

Note:
When you set the preserveolduserexperience parameter to true, the sites in the content database keep the look of the previous version after upgrade. When you set this parameter to false, the sites are upgraded to the new look and feel. The default for this parameter is true, which preserves the old look and feel.

This parameter is part of the Visual Upgrade feature. For more information, see Plan visual upgrade (SharePoint Server 2010).



For more information, see Addcontentdb: Stsadm operation (Office SharePoint Server).

Verification: Verify upgrade for the first database
After you have attached a database, you can use the Upgrade Status page in Central Administration to check the status of upgrade on your site collections. After the upgrade process is complete, you can review the upgrade log file to see whether there were any issues during upgrade. Also, you can review each upgraded site to find and address any issues with how the content is displayed. For more information, see Verify upgrade and review upgraded sites (SharePoint Server 2010).

To view the Upgrade Status page
In Central Administration, click Upgrade and Migration, and then click Check upgrade status.

To open the upgrade log file
The upgrade error log file and the upgrade log file are located at %COMMONPROGRAMFILES%\Microsoft Shared\web server extensions\14\LOGS. The logs are named in the following format: Upgrade-YYYYMMDD-HHMMSS-SSS-error.log and Upgrade-YYYYMMDD-HHMMSS-SSS.log, where YYYYMMDD is the date and HHMMSS-SSS is the time (hours in 24-hour clock format, minutes, seconds, and milliseconds). An example for an upgrade error log is Upgrade-20090415-132126-374-error.log, and an example for an upgrade log is Upgrade-20090415-132126-374.log.

Note:
The upgrade log file includes the name of the content database being upgraded.



Upgrade the shared services database
Before you can upgrade any My Sites in your environment, you must configure the User Profile service and Managed Metadata service and upgrade the Shared Services Provider (SSP) database. To do this, you must perform the following tasks:

Create an application pool for the User Profile service.


Verify that the Managed Metadata service is enabled.


Enable the User Profile service and upgrade the SSP database.

Note:
When you upgrade the SSP database, the audience information is also upgraded.



Create a new proxy for the User Profile service application and associate it with the default proxy group.


The following procedures provide the steps for these tasks.

Important:
The steps in the following sections assume that you have not yet enabled the User Profile service application or the User Profile Synchronization service. If you have already enabled these services, follow these steps to create a separate instance of the User Profile service application. You can associate your existing User Profile Synchronization service with the new User Profile service application.



To create an application pool for the User Profile service by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

To create the application pool, at the Windows PowerShell command prompt, type the following command:

Copy Code
New-SPServiceApplicationPool -Name
-Account
Where:

is the name you want to use for the application pool.


is a valid account. You can use a domain account, or you can use the name of a managed account in the farm. Use the Get-SPManagedAccount cmdlet to view the existing managed account in the farm.


For more information, see New-SPServiceApplicationPool.

To verify that the Managed Metadata service is enabled
In SharePoint Central Administration, on the Application Management page, click Manage service applications.

Verify that the Managed Metadata service is started.

For more information about how to enable and manage this service, see Managed metadata administration (SharePoint Server 2010).

To enable the User Profile service and upgrade your SSP database by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

To enable the User Profile service and upgrade the SSP database, at the Windows PowerShell command prompt, type the following command:

Copy Code
New-SPProfileServiceApplication -applicationpool -Name -Profiledbname [-Profiledbserver ]
Where:

is the application pool name that you created in the previous step.


is the service application name you want to use.


is the name of the database that contains the profile information.


is the name of the server to which you are attaching the database.


For more information, see New-SPProfileServiceApplication.

To create the proxy for the User Profile service and associate it with the default proxy group by using Windows PowerShell
Verify that you meet the following minimum requirements: See Add-SPShellAdmin.

On the Start menu, click All Programs.

Click Microsoft SharePoint 2010 Products.

Click SharePoint 2010 Management Shell.

To configure the proxy for the User Profile service, at the Windows PowerShell command prompt, type the following command:

Copy Code
New-SPProfileServiceApplicationProxy -ServiceApplication -Name -DefaultProxyGroup

Where:

is the GUID of the service application you created in the previous step.


is the proxy name you want to use.


DefaultProxyGroup specifies that the User Profile service application proxy be added to the default proxy group for the local farm.


For more information, see New-SPProfileServiceApplicationProxy.

Make sure that your farm administration account has Full Control of the Use Profile service. Use the following procedure to grant the farm administration account full control.

Update permissions on the User Profile service
In SharePoint Central Administration, on the Application Management page, click Manage Service Applications.

Click the User Profile Service Application row (not the link) and then, on the ribbon, click Administrators.

In the Administrators for User Profile Service Application dialog box, in the To add an account, or group, type or select it below and click 'Add' box, type the farm administrator account and the account you are using to run the User Profile service, and then click Add.

In the Permissions for box, select the Full Control check box, and then click OK.

Start the User Profile Synchronization service
In SharePoint Central Administration, on the System Settings page, click Manage Services on Server.

Next to the User Profile Synchronization service, click Start.

In the Select the User Profile Application dialog box, select the application you just created.

In the Service Account Name and Password section, type and confirm the password for the service account.

Click OK.

Important:
After you have enabled the User Profile Synchronization service, you can reapply the settings that you used for User Profile Synchronization from your Office SharePoint Server 2007 environment in your new environment. Reapply settings such as connections, property mappings, and filters. For more information about how to configure this service, see Configure profile synchronization (SharePoint Server 2010).

Note that the User Profile Synchronization service is not available in a stand-alone environment. You must have a server farm installation to use this service.



Now you are ready to upgrade My Sites.

Upgrade My Sites
If you have My Sites in your environment, you can upgrade them after you have upgraded the Shared Services Provider (SSP) database. You should have created the My Site host Web application when you created your new environment. To upgrade My Sites, you configure the My Site host URL, and then upgrade the content databases that contain My Sites.

To configure the My Site host URL
In Central Administration, on the Manage Service Applications page, click the User Profile service application that you want to associate with My Sites.

On the Manage Profile Service: User Profile Service page, click Setup My Sites.

Enter the information to set up My Sites, including the new My Site host location and personal site location.

The My Site host is a site collection on the content database, which will have a URL like http:// Fabrikam/my. The personal site path is the managed path at which all My Sites will be created. If you entered "personal" in the Location box, My Sites would be created at http:// Fabrikam/personal/username).

After you set up My Sites, you must reset Internet Information Services (IIS) by opening a Command Prompt window and typing iisreset /noforce at the command prompt.

Now that you have created the My Site host URL, you can upgrade My Sites. Follow the steps in Add the content databases to the Web applications later in this article to attach and upgrade the database or databases that contain My Sites. You can upgrade My Sites at any time after you have upgraded the SSP database and configured the My Site host URL.

Attach the remaining databases
After you restore the first content database and verify the upgrade by reviewing the upgrade log file, you can continue by restoring and upgrading the next database or databases. You can attach multiple databases at the same time in separate Command Prompt windows to run multiple upgrades at one time. After you successfully restore and upgrade all the sites, content databases, and SSP databases, you can review the sites to make sure that they were upgraded correctly.

Verification: Verify upgrade for additional databases
After upgrading any additional databases, view the Upgrade Status page to monitor progress and verify that the upgrade process is complete. Review the log file to identify any other issues, and then review each upgraded site to find and address any issues with how the content is displayed