Wednesday, May 11, 2011

New SharePoint Wiki Page Default Content

When you create a new SharePoint 2010 Enterprise Wiki site you will see default content on the home page.  However, new wiki pages are created without any content.

What if you wanted to have some default content that defined a template for your Wiki pages?  This would just be content that could be modified by users, but could at least provide a template for your users to build on.

Well there is not a simple way to configure this, but you can accomplish it with a custom page layout that you can associate with your Enterprise Wiki, and even set as the default page layout for new pages.

First, create a custom page layout for the Enterprise Wiki, following the instructions here: http://blog.henryong.com/2010/06/08/how-to-create-custom-sharepoint-2010-page-layouts-using-sharepoint-designer-2010/


After this, you should have a custom page layout based on the default page layout for the Enterprise Wiki.  You can edit the PublishingWebControls:RichHtmlField tag, adding an "html" attribute, and setting the value to the HTML content that you would like to have displayed on all new pages.

So, the tag would look something like this:

<PublishingWebControls:RichHtmlField  id="PageContent" FieldName="PublishingPageContent" Html="{default html content here}" DisableInputFieldLabel="true" runat="server"/>

Set your new page layout as the default page layout for new Wiki pages and you're new pages will have this default content for all new pages.

Thursday, September 9, 2010

Useful Sharepoint Utility: SharePoint Manager 2010

SharePoint Manager 2010, available from Codeplex here. Allows you to connect to a SharePoint server and browse the SharePoint object model.

You can use SharePoint Manager to view the structure of lists, obtain the GUID for objects, and even make changes (be careful!).


To use it, copy the program to the server and run SharePoint Manager 2010 as Administrator.  SharePoint Manager 2010 will automatically open the local server.


SharePoint Manager 2010: http://spm.codeplex.com

Tuesday, August 31, 2010

SharePoint 2010 Spell Check on Page Check-In

Just a little summary of how spell check works when you check-in a page...

 When you check in a document, SharePoint will run it through spell check.  Under the Comments box you'll see a Spelling section.  While the document is being processed, you'll see a message:





After spell check is complete, you'll see a count of spelling errors, if any:



You need to cancel the check-in and return to the document to review and change your spelling errors.

Errors are underlined with a red squiggly line, as shown here:

Correct the text, or right-click the text and you'll be presented with a list of suggested words:

Thursday, August 26, 2010

SharePoint 2010 AJAX broken

We had an issue where some users running IE7 and IE8 were getting strange errors loading SharePoint pages.  These errors effectively broke the Ajax interface so users were unable to edit list items, design pages, etc.

We received the following errors while loading the page:
Line: 2
Char: 1
Error: Invalid character
Code: 0
URL: http://.../Pages/default.aspx
Line: 2

Char: 1
Error: Invalid character
Code: 0
URL: http://.../Pages/default.aspx
Line: 204

Char: 1
Error: 'Sys' is undefined
Code: 0
URL: http://.../Pages.default.aspx
Line: 974

Char: 1
Error: 'Sys' is undefined
Code: 0
URL: http://.../Pages.default.aspx

Line: 3
Char: 1
Error: 'Type' is undefined
Code: 0
URL: http://.../Pages.default.aspx

Line: 3
Char: 132
Error: Object doesn't support this property or method
Code: 0
URL: http://.../Pages.default.aspx

Additionally, some users were getting the message "'ASP.NET Ajax client-side framework failed to load."

The issue appeared to be with how some workstations where handling the javascript code loaded through ScriptResource.axd.


The solution?

Turning off compression on the script resource handler did the trick.


For IIS7, edit the web.config file associated with the SharePoint site:

Modify the following item in the config file, or add it if it is missing:
<scriptResourceHandler enableCompression="false" enableCaching="true" />

Inside this section:
<system.web.extensions>
      <scripting>

Wednesday, August 25, 2010

U.S. Government Is Driving Tech Jobs Overseas

According to this CNET article, Intel CEO Paul Otellini accuses the U.S. Government of making business conditions so hostile they are likely to lead to "... an inevitable erosion and shift of wealth ..." 

That is a shift of wealth away from the United States.  One could argue that wealth has already been shifted and we are just waiting for our creditors to send us the bill.

My favorite quote: 
 "I think this group does not understand what it takes to create jobs. And I think they're flummoxed by their experiment in Keynesian economics not working."
He's hit the nail on the head.  While the U.S. Government has been preoccupied trying to shore up the housing market and redistribute wealth, they seemed to have forgotten that tax revenues come from the operations of the private sector.

Is it not to obvious that as these businesses leave they take jobs with them, leaving more of us unemployed and further reducing the tax base?  

Original article URL: http://news.cnet.com/8301-13578_3-20014563-38.html?tag=topStories1

'No User Profile Application available to service the request' for YOU!

A feature that deploys webparts to our SharePoint solution had some code in the FeatureActivated routine to add some properties to user profiles.  These properties maintained information about how individual webparts are to be displayed to the user (collapsed or expanded state, default sort order, etc.).  However, I was unable to deploy the solution to my local test machine because I received the following error message:  'No User Profile Application available to service the request.'

While I could not configure user profile synchronization on my workstation, I thought I had configured the User Profile Service Application, and everywhere I looked, it appeared that the service was up and running properly.

It turns out that this "catch all" message simply indicates that a connection could not be established to the User Profile Service.  This could mean that it is not running, OR possibly you have not granted the proper permissions to the service application.

The solution?  Add my local administrator account to the list of administrators and explicitly grant permission to that account on the Manage Service Applications page in Central Administration.

In Central Administration, click on "Manage Service Applications" under "Application Management."  Then select the User Profile Service Application.  Click "Administrators" and add your administrator account here.  Then, return to the Manage Service Applications page, select the User Profile Service Application again, click "Permissions" and add your account here, granting full control.

For more detail, see the following blog post: http://blogs.technet.com/b/speschka/archive/2010/02/22/no-user-profile-application-available-mystery-in-sharepoint-2010.aspx

Tuesday, August 24, 2010

Access a Remote SQL Server as Another Windows User

On a production SharePoint server we do not have SQL installed, or the SQL Management Studio.  My account does not have access to the box that hosts SQL.  When I tried to open the server in SQL Server Management Studio, using Windows Authentication, I found that I am unable to change the account that is used to authenticate to SQL Server.

The trick is to run SQL Server Management Studio as another user.  This can be done by opening a command prompt and issuing the following command (replace the sections in brackets with your own domain and account information):

runas /netonly /user:{domain}\{sp_admin account} "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"
You'll be prompted:

Enter the password for {domain}\{sp_admin account}:

Enter the password and voila! you are connected to SQL Server as another user!