12/29/2009

SharePoint: Add a “You are leaving this site” message to a links list.

 

This article is a variation of “http://techtrainingnotes.blogspot.com/2009/07/sharepoint-adding-popups-to-link-lists.html” and makes just one small change:

Replace:

links[i].target="_blank“

With:

links[i].onclick=function () {alert('you are now leaving this site')}

 

The links list web part is a quick and easy to add a list of links to vendors, other SharePoint sites or the most popular documents in a library. The problem is that the links list web part does warn users that they are about to leave your site (and you may have a legal reason to tell them so).

A typical links list:

            image

To change a links list to display an exit message:

  • Add a Content Editor Web Part (CEWP) just below the links list web part
  • Modify the CEWP and set a title then click Source Editor
  • Copy and paste the HTML and JavaScript below
  • Edit the JavaScript to change the word “Links” to the name of your links list web part (title of the web part, not the title of the actual list, although they may be the same)
    if (x(i).summary=="Links")     to
    if (x(i).summary=="Your Links List Title")
    (If you are not sure, display your page, select Source from the View menu and search for “.summary”)
  • Also… in the Advanced section of the CEWP’s properties change Chrome to “None” to hide the CEWP
  • Exit the edit mode and see if it works

 

<script>
// CEWP trick from techtrainingnotes.blogspot.com!
// Find the link list  (change "Links" to your web part's name)
var x = document.getElementsByTagName("TABLE") // find all of the Tables 
  var LinkList
  var i=0;
  for (i=0;i<x.length;i++) 
  {
    if (x[i].summary=="Links")
    {
      //
      LinkList = x[i];
      break;
     } 
  }

// add a target to the <A> tags
var links = LinkList.getElementsByTagName("A") // find all of the 
  for (i=0;i<links.length;i++) 
  {
    links[i].onclick=function () {alert('you are now leaving this site')}
  }
</script>

 

 

.

12/23/2009

SharePoint: Wiki Search and Replace

 

Note: The following works in both SharePoint 2007 and 2010. Just be aware that the 2010 “Site Pages” library is also a wiki library!

 

Recently I was asked about how to do a search and replace on text in all of the articles in a wiki. As there is no built-in way to do this I wrote a simple web page to do this.

Note that the example below is trivial and:

  • Is presented as a learning exercise
  • Does not include a master page
  • Must be deployed to the Layouts folder of the web servers
  • Is case sensitive
  • Is over all not too flexible… but it is presented to get you started on your own nice looking page…
Background:
  • A wiki is a library (and a library is just a fancy list)
  • The content displayed in a wiki is stored in a column of the library named “WikiField” (creative huh!)
  • Accessing a list and updating data via the SharePoint API is pretty easy
What you could do to make this better:
  • Just about anything…  ;-)
  • Add support for “Ignore Case”
  • Add a checkbox list of what was found and let the user decide to replace or not
  • Add the application master page and make this look like SharePoint
  • Write it as a little Windows application that calls the SharePoint web services so nothing has to be deployed to the web servers

Here’s what the page looks like:
image

To create this you will need to create a web page (ASPX) and a code behind file and copy them to the LAYOUTS folder on the web front end servers. You will then access the page by going to the site with the wiki(s) and navigating to the new page:
   http://yourserver/sites/yoursite/_layouts/WikiSearchReplace.aspx

 

What’s the <SharePoint:FormDigest runat="server" /> about? See here.

The ASPX page:  (WikiSearchReplace.aspx)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WikiSearchReplace.aspx.cs"
  Inherits="WikiSearchReplace" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
  Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  <title>Untitled Page</title>
</head>
<body>
  <form id="form1" runat="server">
    <SharePoint:FormDigest runat="server" />
    <div>
      Wiki Libraries:
      <asp:DropDownList ID="ddlWikis" runat="server">
      </asp:DropDownList><br />
      <br />
      <table>
        <tr>
          <td>
            Find what:</td>
          <td>
            <asp:TextBox ID="txtFind" runat="server" /></td>
        </tr>
        <tr>
          <td>
            Replace with:</td>
          <td>
            <asp:TextBox ID="txtReplace" runat="server" /></td>
        </tr>
      </table>
      <asp:Button ID="btnReplace" runat="server" Text="Replace" OnClick="btnReplace_Click" />
      <br />
      <asp:Label ID="lblResults" runat="server" />
    </div>
  </form>
</body>
</html>

and here’s the code behind: (WikiSearchReplace.aspx.cs)
using System;
using System.Web;
using Microsoft.SharePoint;

public partial class WikiSearchReplace : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get a list of all WIKIs in the site and add to the dropdown
        // WIKI = SPListTemplateType.WebPageLibrary
        if (!IsPostBack)
        {
            SPWeb web = SPContext.Current.Web;
            foreach (SPList lst in web.Lists)
            {
                if (lst.BaseTemplate == SPListTemplateType.WebPageLibrary)
                {
                    ddlWikis.Items.Add(lst.Title);
                }
            }
        }
    }

    protected void btnReplace_Click(object sender, EventArgs e)
    {
        // Get the current site
        using (SPWeb web = SPContext.Current.Web)
        {
            SPList list = web.Lists[ddlWikis.SelectedItem.ToString()];

            int articleCount = 0;
            int occurrenceCount = 0;
            string wikiText = "";

            foreach (SPListItem wikiItem in list.Items)
            {
                wikiText = wikiItem["WikiField"].ToString();
                if (wikiText.Contains(txtFind.Text))
                {
                    articleCount++;

                    // a trick to get the word cound
                    int count = (wikiText.Length - wikiText.Replace(txtFind.Text, "").Length) / txtFind.Text.Length;
                    occurrenceCount += count;

                    wikiItem["WikiField"] = wikiText.Replace(txtFind.Text, txtReplace.Text);
                    wikiItem.Update();
                }
            }
            lblResults.Text = articleCount.ToString() + " articles updated, " + occurrenceCount.ToString() + " occurrences updated";
        }
    }
}

SharePoint: The security validation for this page is invalid

 

Note: The following applies to both SharePoint 2007 and 2010.


When creating an ASPX page in the LAYOUTS folder that updates SharePoint content via the API (mylistitem.upate) you may get the following message when posting back to the page:

 

2007:
image

2010:
image

Many articles on the web suggest using AllowUnsafeUpdates:

SPWeb web = SPContext.Current.Web;
web.AllowUnsafeUpdates = true;


While this works, it does open the page up to cross-site scripting vulnerabilities. (See here: MSDN)

A better practice is to add a FormDigest control to your page. (See details here: MSDN)  If you are not using a master page or a complete “SharePoint page” then you will also need to add a Register line to reference Microsoft.SharePoint.WebControls.

The reference:

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

The control:

  <SharePoint:FormDigest runat=server/>

A sample page:

 

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<SharePoint:FormDigest runat=server/>
<div>
<asp:TextBox ID="txtSomeText" runat="server" />
<asp:Button ID="btnReplace" runat="server" Text="Replace" OnClick="btnDoSomeWork_Click" />
</div>
</form>
</body>
</html>






.

12/21/2009

SharePoint: Worst SharePoint Error Message?

(MOSS 2007)

“WSS_Search_servername on servername contains user-defined schema. Databases must be empty before they can be used. Delete all of the tables, stored procedures and other objects or use a different database.”

 

Just got this on one of my virtual machines:

image

 

I just love this part: “Delete all of the tables, stored procedures and other objects or use a different database.” That’s kind of like responding to “I can’t connect to the internet” with “format drive C: and start over”.

Either the developer was having a bad day or has a real attitude!

 

Is this important?   Not really!   WSS Search is only used in MOSS to index the SharePoint help files, and this only needs to be done once (at least until the next service pack potentially updates the search content).  And, have you ever found this help content to be very helpful?

So for now… help works, but is just not searchable. You can still navigation the table of contents. (But I do have a fix at the end of this article…)

 

No results: But should look like this:
image image

                                                           

 

How I got the error:

This message was displayed in Central Administration when I tried to start the search services. I’m not sure why they were stopped. I may have stopped them to improve performance on the VPC or they may have just stopped.

image

 

 

A similar error was logged in the Windows Event log:

image

 

 

 

The fix?

Go to Central Administration to the services on server list and click start for the WSS Search. Enter a new database name!  I just appended a “B” to the end of the existing name.  (You can now go to your SQL admin tools and delete the old database if you like.)  I also had to do an IISRESET, but could have probably waited and it would have reindexed.

And… after you get it working and the content has been index, stop it!  Or at least set the schedule so it only indexes once a night. The Help content NEVER CHANGES!

image

12/07/2009

SharePoint 2010: Change the passphrase

 

When you install SharePoint using an option other than Stand-Alone you will be asked for a “Passphrase” that can be used later on for things like adding a new server to the farm. This is especially needed if you let SharePoint 2010 manage your service account passwords where SharePoint will automatically change the passwords to strong, but unknown passwords.

I don’t think there is anyway to retrieve the passphrase if you forget it. If you need to change the passphrase after the install you can use PowerShell. (Don’t know PowerShell yet? You will…) 

  • From your Start menu select “SharePoint 2010 Management Shell” or Start, “Microsoft SharePoint 2010 Products”, “SharePoint 2010 Management Shell”
  • Then enter:

      C:\PS> $passphrase = ConvertTo-SecureString -asPlainText -Force
      C:\PS> Set-SPPassPhrase -PassPhrase $passphrase -Confirm

The first line will prompt you for a password and store the secure version in the $passphrase variable.
The second line will prompt you to confirm the passphrase and then ask you if you are REALLY sure you want to do this.

 

image

 

I have not seen anything in TechNet on this command yet. For help on this command from PowerShell type:

    help passphrase

      or

    help passphrase  -examples

image

12/06/2009

Silverlight: Useful links

Below are some of the resources I refer to in my Silverlight classes.

These include:

  • Official Sites
  • Tutorial Sites
  • Best places to ask questions (forums)
  • What’s new in Silverlight 3
  • What’s new in Silverlight 4
  • Downloads
  • Other useful links

 

Official Sites:

 

They both claim to be “the official site”!

Sites for Expression Blend:

MSDN Library for Silverlight

 

Tutorial Sites:

 

 

Best places to ask questions:


MSDN forums:

Silverlight.net Forums:
(As of 12/5/09: 178,572 threads and 222,975 posts, contributed by 67,146 members from around the world!)

  • http://forums.silverlight.net/default.aspx
    • Installation and Setup
    • Getting Started
    • Hosting and Streaming
    • New Features in Silverlight 3
    • Silverlight 4 Beta
    • Designing with Silverlight
    • Video and Media
    • Expression Studio
    • Programming with JavaScript
    • Programming with .NET – General
    • Silverlight Controls and Silverlight Toolkit
    • Visual Studio & Silverlight Development Tools
    • Report a Silverlight Bug
    • Accessing Web Services with Silverlight
    • Game Development
    • WCF RIA Services

 

What’s new in Silverlight 3:

 

What’s new in Silverlight 4:

 

Downloads:

Other useful links…

 

What percent of users actually have Silverlight installed?

Datasets and Data Tables with Silverlight:

As a .Net developer we know DataSets and DataTables, and we often deliver these via web services, but Silverlight does not directly support Datasets or Datatables. There are a few workarounds using LINQ, custom libraries and even a custom grid control…

Pushing data to Silverlight from a server

Dealing with Cross-Domain issues

About loading images (and URLs)

Silverlight to JavaScript, JavaScript to Silverlight:

 Silverlight and SharePoint

12/03/2009

SharePoint 2010: Office Web Apps – The “in browser” Office

One of the cool features demo’ed with SharePoint 2010 are the “in browser” Office Web Apps. These are browser based versions of Word, Excel, PowerPoint and OneNote. But…  you won’t find these when you download and install Beta 2. They are a separate download and install.

Cool stuff:

  • Create, View and Edit Excel, Word and PowerPoint documents (BUT only Office 2007 and 2010 documents – docx, pptx, xlsx)
  • View and edit Word documents
  • Co-author Excel files (really! two people editing the same file at the same time and see each other’s changes as they are made!)
  • View PowerPoints, with transitions, fades, etc!  In the browser or as a full screen slide show.

Things to download and notes:

  • The instructions: Deploy Office Web Apps
  • The license key is in the above document!
  • The install file: WcServer_?????.exe  (you can download one of seven language versions)  (WcServer_en-us.exe for English)
  • Run the install
  • If you installed SharePoint as a “Standalone install” (Basic install) then do not follow the instructions in the above word document to enable the services, they were already running. All I needed to do was to go to the site collection and enable the “Office Word Apps” feature. All done… that’s all…

Other notes:

  • So far I have not seen how to create a new document using these features. The New button in the library still launches the desk top application.

Excel Web App in View mode:

  image

In Edit mode:

  image

11/30/2009

SharePoint 2010: SharePoint Server Databases

 

 

The following is a list of databases installed in a “Basic” install of SharePoint Server 2010.

 

Notes:

  • SQL Server Express 2008 Service Pack 1 was installed

       Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)
           Mar 29 2009 10:11:52
           Copyright (c) 1988-2008 Microsoft Corporation
           Express Edition (64-bit) on
            Windows NT 6.1 <X64> (Build 7600: ) (VM)

  • If you want to install the SQL Express Management Tools:
    • remember to download the 64 bit version
    • check out this article or you won’t guess the correct choice (New Installation, not Add new features) http://www.asql.biz/Articoli/SQLX08/Art3_1.aspx
    • the SQL Profiler is not part of the Express tools
  • A new instance was created named SHAREPOINT  (yourservername.SHAREPOINT). The instance was created in
    C:\Program Files\Microsoft SQL Server\MSSQL10.SHAREPOINT
  • The databases were created in:
    C:\Program Files\Microsoft Office Servers\14.0\Data\MSSQL10.SHAREPOINT\MSSQL\DATA
    (Foundation defaults to here: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Data\MSSQL10.SHAREPOINT\MSSQL\DATA)

Database Names:

  • The “system” databases are named with GUIDs. We used to avoid this, or rename these, but it’s probably best to now leave these alone.
  • In SharePoint Foundation 2010 these include:
    • Bdc_Service_DB_guid   -  Business Connectivity Services (BCS)  (the old BDC)
    • SharePoint_AdminContent_guid  - Central Administration
    • SharePoint_Config_guid – the SharePoint Configuration database
  • In SharePoint Server 2010 they add:
    • Application_Registry_Service_DB_guid
    • Managed Metadata Service_guid
    • PerformancePoint Service Application_guid
    • Search_Service_Application_CrawlStoreDB_guid
    • Search_Service_Application_DB_guid
    • Search_Service_Application_PropertyStoreDB_guid
    • Secure_Store_Service_DB_guid
    • StateService_guid
    • User Profile Service Application_ProfileDB_guid
    • User Profile Service Application_SocialDB_guid
    • User Profile Service Application_SyncDB_guid
    • WebAnalyticsServiceApplication_ReportingDB_guid
    • WebAnalyticsServiceApplication_StagingDB_guid
    • Word Automation Services_guid
  • The content databases follow the 2007 pattern: WSS_Content or what ever you enter when you create a new application. (and I thought the “WSS” name was gone!)
  • WSS_Search_yourservername – The WSS search database
  • The new logging database! WSS_Logging. Think of this one as the one SharePoint database you are supposed to do direct TSQL queries from! As a teaser… here’s a list of the views (I’d show the tables, but each has 32 partitions): 
                                                   image

Files from my install (your GUIDs will vary)

    image

  Databases and log files in SharePoint Foundation 2010:

  • Bdc_Service_DB_778ccd3e047d45c1b71529c004ebbd2c.mdf
    Bdc_Service_DB_778ccd3e047d45c1b71529c004ebbd2c_log.LDF
  • SharePoint_AdminContent_4ab2813a-fe77-4085-86df-41d3a79df116.mdf
    SharePoint_AdminContent_4ab2813a-fe77-4085-86df-41d3a79df116_log.LDF
  • SharePoint_Config_e5403261-4d7a-4b9e-bef2-286c46b588da.mdf
    SharePoint_Config_e5403261-4d7a-4b9e-bef2-286c46b588da_log.LDF
  • WSS_Content.mdf
    WSS_Content_log.LDF
  • WSS_Logging.mdf
    WSS_Logging_log.LDF
  • WSS_Search_MAXSP2010BETA2.mdf
    WSS_Search_MAXSP2010BETA2_log.LDF

   Additional databases and log files in SharePoint Server 2010:

  • Application_Registry_Service_DB_b669b0a586ce4cfaa1020e9e75824843.mdf
    Application_Registry_Service_DB_b669b0a586ce4cfaa1020e9e75824843_log.LDF
  • Managed Metadata Service_6b696a9bda574b29a0bba4009c782316.mdf
    Managed Metadata Service_6b696a9bda574b29a0bba4009c782316_log.LDF
  • PerformancePoint Service Application_106ff2206d784297adbd4ec157aef7b5.mdf
    PerformancePoint Service Application_106ff2206d784297adbd4ec157aef7b5_log.LDF
  • Search_Service_Application_CrawlStoreDB_16d445d62e314cd58c82d75fc304a225.mdf
    Search_Service_Application_CrawlStoreDB_16d445d62e314cd58c82d75fc304a225_log.LDF
  • Search_Service_Application_DB_e172668d1a534fd981b53146014d5ef3.mdf
    Search_Service_Application_DB_e172668d1a534fd981b53146014d5ef3_log.LDF
  • Search_Service_Application_PropertyStoreDB_10c4d562200442748ca6339d4b358c84.mdf
    Search_Service_Application_PropertyStoreDB_10c4d562200442748ca6339d4b358c84_log.LDF
  • Secure_Store_Service_DB_edd7b8e261fa491bb336779301aa5bf9.mdf
    Secure_Store_Service_DB_edd7b8e261fa491bb336779301aa5bf9_log.LDF
  • StateService_335919bb65d1430aa20424a67a99589e.mdf
    StateService_335919bb65d1430aa20424a67a99589e_log.LDF
  • User Profile Service Application_ProfileDB_9e421f2d762c46609a8a15fab15a3d52.mdf
    User Profile Service Application_ProfileDB_9e421f2d762c46609a8a15fab15a3d52_log.LDF
  • User Profile Service Application_SocialDB_81269e32afd049d48994a72362806da4.mdf
    User Profile Service Application_SocialDB_81269e32afd049d48994a72362806da4_log.LDF
  • User Profile Service Application_SyncDB_8c10242fd8064682aa1ac620acfa1733.mdf
    User Profile Service Application_SyncDB_8c10242fd8064682aa1ac620acfa1733_log.LDF
  • WebAnalyticsServiceApplication_ReportingDB_1684bae4-0271-40f0-9e4d-84c6660e99e0.mdf
    WebAnalyticsServiceApplication_ReportingDB_1684bae4-0271-40f0-9e4d-84c6660e99e0_log.LDF
  • WebAnalyticsServiceApplication_StagingDB_13d64d79-9237-492c-ad2d-48785d13a1ff.mdf
    WebAnalyticsServiceApplication_StagingDB_13d64d79-9237-492c-ad2d-48785d13a1ff_log.LDF
  • Word Automation Services_5fd65b951cf1499eaa72997b9668fd04.mdf
    Word Automation Services_5fd65b951cf1499eaa72997b9668fd04_log.LDF

 

  There are also the standard SQL Server databases there:

  • master.mdf
  • mastlog.ldf
  • model.mdf
  • modellog.ldf
  • MSDBData.mdf
  • MSDBLog.ldf
  • tempdb.mdf
  • templog.ldf

   And this file:

  • MS_AgentSigningCertificate.cer

.

SharePoint 2010: Error Messages

 

A few end-user (browser) error messages common in SharePoint 2010 Beta 2…

 

Message from webpage:

 

image

- A datasheet component compatible with Microsoft SharePoint Foundation is not installed.

- Your Web browser does not support ActiveX controls.

- A component is not properly configured for 32-bit or 64-bit support.

 

The error above most often from not having a suitable version of Microsoft Office installed.

This error is often display when trying to use:

  • Multiple file upload
  • Datasheet view

 

This control is currently disabled

Error displayed from the ribbon:

image

 

This error is often display when trying to use:

  • Multiple file upload
  • Outlook sync when Outlook is not installed

Message from webpage – The document could not be created.

The following message is from clicking the New button in a document library when Office is not installed.

image

 

Excel Export

image

No Excel 2007 or 2010 installed.

SharePoint 2010: SharePoint Foundation Databases

 

The following is a list of databases installed in a “Basic” install of SharePoint Foundation 2010.

 

Notes:

  • SQL Server Express 2008 Service Pack 1 was installed
  •    Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)
           Mar 29 2009 10:11:52
           Copyright (c) 1988-2008 Microsoft Corporation
           Express Edition (64-bit) on
            Windows NT 6.1 <X64> (Build 7600: ) (VM)

  • If you want to install the SQL Express Management Tools:
    • remember to download the 64 bit version
    • check out this article or you won’t guess the correct choice (New Installation, not Add new features) http://www.asql.biz/Articoli/SQLX08/Art3_1.aspx
    • the SQL Profiler is not part of the Express tools
  • A new instance was created named SHAREPOINT  (yourservername.SHAREPOINT). The instance was created in
    C:\Program Files\Microsoft SQL Server\MSSQL10.SHAREPOINT
  • The databases were created in:
    C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Data\MSSQL10.SHAREPOINT\MSSQL\DATA

Database Names:

  • The “system” databases are named with GUIDs. We used to avoid this, or rename these, but it’s probably best to now leave these alone.
    In SharePoint Foundation these include:
    • Bdc_Service_DB_guid   -  Business Connectivity Services (BCS)  (the old BDC)
    • SharePoint_AdminContent_guid  - Central Administration
    • SharePoint_Config_guid – the SharePoint Configuration database
  • The content databases follow the 2007 pattern: WSS_Content or what ever you enter when you create a new application. (and I thought the “WSS” name was gone!)
  • WSS_Search_yourservername – The WSS search database
  • The new logging database! WSS_Logging. Think of this one as the one SharePoint database you are supposed to do direct TSQL queries from! As a teaser… here’s a list of the views (I’d show the tables, but each has 32 partitions):
                                                   image

Files from my install (your GUIDs will vary)

       image

  Databases and log files:

  • Bdc_Service_DB_778ccd3e047d45c1b71529c004ebbd2c.mdf
    Bdc_Service_DB_778ccd3e047d45c1b71529c004ebbd2c_log.LDF
  • SharePoint_AdminContent_4ab2813a-fe77-4085-86df-41d3a79df116.mdf
    SharePoint_AdminContent_4ab2813a-fe77-4085-86df-41d3a79df116_log.LDF
  • SharePoint_Config_e5403261-4d7a-4b9e-bef2-286c46b588da.mdf
    SharePoint_Config_e5403261-4d7a-4b9e-bef2-286c46b588da_log.LDF
  • WSS_Content.mdf
    WSS_Content_log.LDF
  • WSS_Logging.mdf
    WSS_Logging_log.LDF
  • WSS_Search_MAXSP2010BETA2.mdf
    WSS_Search_MAXSP2010BETA2_log.LDF

 

  There are also the standard SQL Server databases there:

  • master.mdf
  • mastlog.ldf
  • model.mdf
  • modellog.ldf
  • MSDBData.mdf
  • MSDBLog.ldf
  • tempdb.mdf
  • templog.ldf

 

  And this file:

  • MS_AgentSigningCertificate.cer

 

 

image

11/29/2009

SharePoint 2010: Select Template Later!

In SharePoint 2003 an administrator could create a new site collection without having to select a template. The link to the new site collection could then be emailed to the new owner and on their first visit to the new URL they could select a template. This option disappeared in 2007. It’s back in 2010! (but with a very interesting difference… see below…)

Note: This only works from Central Administration when creating a new site collection. It is not available when creating sub sites within an existing site.

 

When creating a site in Central Administration:

image

 

When first visiting the new URL:

image

 

What’s Different?

In 2003 you had to select a template before continuing. Now in 2010 you actually have a functioning, but template-less, site. See the Site Actions, View All Site Content and Recycle Bin options? They all work even though a template has not been selected yet.

The new (template-less) site defaults to /_layouts/templatepick.aspx as a home page. There is no default.aspx page or Site Pages library yet.

As a test I went to Central Administration and created a new site collection with this template option. I then went to the site and ignored the request to pick a template and went and changed the site title, the theme, activated the “Team Collaboration Lists” feature and added a Links List for “Vendors”. I then returned to templatepick.aspx page and selected a template. It all seems to work fine.

So now we can:

  • Let the new site owner pick their own template
  • Preload lists and libraries
  • Preselect a theme

Let us know if you find any issues with this…

 

A final note…

If the template can be picked at a later time, can it now be changed?  Sorry, but no. If you return to /_layouts/templatepick.aspx and try to select a different template you will get:

image

 

.

11/27/2009

SharePoint: List and libraries by SharePoint version (2007 & 2010)

Just a quick list… maybe I’ll find some time to add links to resources for each list and library type.

 

image

SharePoint 2010: Missing Search Scope Dropdown

 

In SharePoint 2007 there is a search scope dropdown:

image

 

This is missing in a default setup of SharePoint 2010:

image

 

It’s still available, you just have to turn it on. Just go to Site Actions, Site Settings, Site Collection Administration, Search Settings:

image

Note that this is a site collection setting, not per sub site.

 

Select “Show scopes dropdown and it’s back!

image

 

This was an option only in MOSS 2007. WSS 2007 always had the scope dropdown. I have not checked SharePoint 2010 Framework yet to see if is an option there…

11/26/2009

SharePoint 2010: "the update is not applicable to your computer”

 

If you install SharePoint 2010 Beta 2 you will probably get this error when using search and other services:

Unrecognized attribute 'allowInsecureTransport'

 

If you do a little web searching you will find that you need this update:

KB976462: https://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=23806&wa=wsignin1.0

 

If you have already installed SharePoint 2010 Beta 2 then go ahead and run this patch. But, be aware: “Service Applications that have been successfully provisioned without the update installed may need to be removed and re-provisioned once the update has been successfully applied”

 

If you start a new server build and try to install this patch you will get:

"the update is not applicable to your computer"

You must install the SharePoint 2010 prerequisites first, then install this patch.

 

Then I got this error: (but only on my second build! Go figure…)

“Failed to create sample data”

and found the fix here:  (and then restarted the Configuration Wizard)

http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/f239de4a-488e-47e1-8f1e-b382fd4668fa

 

Here is the correct install order (or at least what worked for me):

  1. Install Windows Server 2008 (I installed 2008 R2 Standard and did no additional configuration except for networking)
  2. If you are going to rename the server, do it before installing SharePoint (or at least before you install SQL Server).
  3. Run the SharePoint install and click “Install SharePoint 2010 prerequisites” and complete this install.
  4. Now install the “patch” (you will need to restart after the install)
  5. Now return to the SharePoint install and click “Install SharePoint Server”

 

Just in case you are curious… the SQL Server installed with a “standalone” install is the 64bit version of SQL Express:

Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)
       Mar 29 2009 10:11:52
       Copyright (c) 1988-2008 Microsoft Corporation
       Express Edition (64-bit) on
        Windows NT 6.1 <X64> (Build 7600: ) (VM)

 

 

.

11/16/2009

SharePoint 2010 Beta 2 now on MSDN and TechNet!

Got an MSDN or TechNet subscription???

But don’t start your download until I’m finished!!!

 

First notes:

  • Both Foundation and Server are available for download
  • The downloads are installers. No virtual disks yet.
  • The download is a single file install. When started in offers a link to “Read the install guide” that when clicks opens a browser to a Microsoft SharePoint 2007 web page. (It’s a beta…)
  • There is a bug!  (Unrecognized attribute 'allowInsecureTransport'") See here for the pending fix, and for additional installation notes:
    http://blogs.msdn.com/opal/archive/2009/11/16/installation-notice-for-sharepoint-2010-public-beta.aspx

11/03/2009

Exam Discounts

This is a note for people who have attended my classes. (Everyone else go see their own MCT!)

If you are thinking about Microsoft certification, check with me before signing up for an exam. I can usually get you a discount on both the exam and on practice exams.

Currently:

  • 10% off of the exam
  • 40% on any MeasureUp 60 Day Online Practice Test

Not all exams qualify, but most MCP exams do. MeasureUp does not have a practice test of every Microsoft exam.

If you would like a discount voucher, email me at the email address I gave you during class or just call MAX Technical Training.

 

Know any college or tech school students? They can 55% off of exams here:
http://www.prometric.com/microsoft/student

.

SharePoint: Hide a web part with zero rows

 

(I wrote this up a few months ago, and then forgot to post it. So here it is finally!)

 

Here’s a JavaScript trick to hide a list or library web part when there are no items in the list, or the current view used in the web part.

 

Steps:

  • On the same page as your web part, add a Content Editor Web Part (CEWP)
  • Select Edit and then Modify Shared Web Part
  • In the Advanced section set the Chrome to none
  • Click the Content Editor button and add the JavaScript from below
  • Replace "Test List" with your web part's name
    (If you don’t know the name or your guess does not work, view the HTML source of the page (View, Source in IE) and do a search for “summary=”.)

Note that the commented out section can be used to just hide the title bar instead of the entire web part.

 

<script>
function HideWebPartWithZeroRows()
{

  var a = document.getElementsByTagName("TABLE")
  for (var i=0;i<a.length;i++)
  {
    if (a[i].summary=="Test List")
    {
      if (a[i].rows.length==1)
      {
        //hide all but the title bar
        //var x =  a[i].parentNode.parentNode.parentNode.parentNode.parentNode

        //hide the entire web part
        var x =  a[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode

        x.style.display="none";
      }
    }
  }

}

_spBodyOnLoadFunctionNames.push("HideWebPartWithZeroRows") 

</script>

 

 

.

10/31/2009

SharePoint: Don’t Upgrade to SharePoint 2010!

 

Don’t upgrade to SharePoint 2010!

   There, I said it.

        Don’t do it.
            Just say no.
                 Put the DVD down and just walk away!

 

Unless when you rolled out 2007….

you really planned ahead,
created the ultimate governance plan document,
enforced that plan,
planned a farm with scalability and redundancy  in mind,
designed your taxonomy,
properly trained your users,
created and routinely executed an audit plan, 
and have a well documented and tested disaster recovery plan,

then you will just be creating the same mess again.

 

Do it right this time!  And then migrate only the business appropriate content into a clean, safe, secure, reliable and useable system.

You have probably learned a lot about SharePoint 2007 and probably learned a lot about how NOT to install it, release it to the corporation, train users and organize sites and data. You most likely now an expert on what NOT to do.

Now go do your homework. You have the time. It’s worth every minute. Go research “governance”, “best practices” and other people’s horror stories. Get your governance team trained on governance and a project methodology. Get your plan together, carefully implement it and enjoy!

 

 

 

.

10/29/2009

Cincinnati SharePoint User Group Meeting (November 2009)

We have a new URL! http://www.CincinnatiSPUG.org
(this still works:  http://cincyspug.securespsites.com )

 

6:00 PM 11/5/09 at MAX Technical Training

Topic: SharePoint 2010 (what else could it be, just after the big announcements!)

 

We have door prizes!  We have a number of SharePoint books and other goodies to give away!
We will also have some discount codes just for people who attend from several major book publishers.

10/26/2009

SharePoint: SharePoint 2010 Posters (Technical diagrams) Available

14 free posters for SharePoint 14!  34-by-44-inch posters.

http://technet.microsoft.com/en-us/library/cc263199(office.14).aspx

 

Services in SharePoint 2010 Products
Describes and illustrates the services architecture, including and common ways to deploy services in your overall solution design.

Cross-farm Services in SharePoint 2010 Products
Illustrates how to deploy services across farms to provide centralized administration of services.

Topologies for SharePoint Server 2010
Describes common ways to build and scale farm topologies, including planning which servers to start services on.

Hosting Environments in SharePoint 2010 Products
Summarizes the support for hosting environments and illustrates common hosting architectures.

Search Technologies for SharePoint 2010 Products
Compares and contrasts the search technologies that work with SharePoint Products 2010:SharePoint Foundation 2010,Search Server 2010 Express,Search Server 2010,SharePoint Server 2010,FAST Search Server 2010 for SharePoint

Search Environment Planning for Microsoft SharePoint Server 2010
Walks through primary architecture design decisions for search environments.

Search Architectures for Microsoft SharePoint Server 2010
Details the physical and logical architecture components that make up a search system and illustrates common search architectures.

Design Search Architectures for Microsoft SharePoint Server 2010
Walks through the initial design steps to determine a basic design for a SharePoint Server 2010 search architecture.

Business Connectivity Services Model
This model poster describes the architecture of Microsoft Business Connectivity Services in SharePoint Server 2010 and provides information about how to create solutions that are based on the service.

Microsoft SharePoint Server 2010 Upgrade Planning
This model covers planning for an upgrade from Microsoft Office SharePoint Server 2007 to SharePoint Server 2010.

Microsoft SharePoint Server 2010 Upgrade Approaches
This model helps you understand the in-place, database attach, and hybrid approaches to upgrading from Office SharePoint Server 2007 to SharePoint Server 2010.

Microsoft SharePoint Server 2010 — Test Your Upgrade Process
This model explains the methodology for testing the upgrade process before upgrading from Office SharePoint Server 2007 to SharePoint Server 2010.

Microsoft SharePoint Server 2010 — Services Upgrade
This model covers upgrading services from Office SharePoint Server 2007 to SharePoint Server 2010.

Choose a tool for business intelligence in SharePoint Server 2010
Discusses the tools available for business intelligence

10/19/2009

SharePoint: Setting a People Picker field using the API

 

Funny how the obvious does not always work… For example, you want to create a new task in code and assign it to some one. You might try to set the Assigned To field to the user's name:

      SPItem itm6 = lst.Items.Add();
      itm6["Title"] = "test2";
      itm6["Assigned To"] = @"MAXSP2007\samc";               //fails!
      itm6.Update();

“Assigned To” is a “People Picker” field and only accepts data in certain ways, any but the obvious. If you read this field you will see a value like:  “8#;MAXSP2007\samc”, and using that value will work…

What the "People Picker” field wants is the ID of the user, the “8”.  The rest appears to be ignored. So, here’s several ways to get there:


itm1["Assigned To"] = web.AllUsers[@"MAXSP2007\samc"]; //works
- itm2["Assigned To"] = 8; //works
- itm3["Assigned To"] = web.AllUsers[@"MAXSP2007\samc"]; //works - SPMember member = web.AllUsers[@"MAXSP2007\samc"]; itm4["Assigned To"] = member.ID; //works - SPMember member = web.AllUsers[@"MAXSP2007\samc"]; itm5["Assigned To"] = member; //works

 

.

 

 

 

9/25/2009

SharePoint: Hiding the Search Box

Sometimes a site or site page has only one purpose, and you don’t want the distraction of the search controls. The search controls are easy to hide and can be hidden at various levels…

 

To hide the search control on just one page:

  • Add a Content Editor Web Part (CEWP)
  • Edit the web part and click the Source Editor button
  • Paste the following:
   <style>
     #SRSB {display:none}
   </style>

 

To hide the search control on all pages:

  • Use SharePoint Designer to edit your master page and put the above style tag just after the SharePoint style controls
   <SharePoint:CssLink runat="server"/>
<SharePoint:Theme runat="server"/>
<style> #SRSB {display:none} </style>

To let the site owners hide or show by using a feature:

The search box is actually an ASP.Net Web User Control (.ASCX) that can be replaced by using a SharePoint “feature”. If you want nothing displayed you can just create a one line .Net Web User Control (using Notepad if you like):
<%@ Control Language="VB" ClassName="yourclassname" %>
Here's an article with enough info to get you started on building the feature (just leave out the Google stuff):
http://techtrainingnotes.blogspot.com/2009/07/sharepoint-custom-search-boxes-google.html

.

8/31/2009

Cincinnati SharePoint User Group Meeting

http://cincyspug.securespsites.com  6:00 PM 9/3/09 at MAX Technical Training

SharePoint -- Externalizing Content BLOBs to a NAS, SAN CAS or to the Cloud 
        Brian Battah, Senior Architect at BlueThread Technologies, will
provide an overview of the performance, security and scalability
benefits of SharePoint BLOB storage. He will also discuss how
BlueThread’s StoragePoint solution can be leveraged to externalize
SharePoint content to different endpoints including Windows Azure BLOB
Storage, EMC Atmos Online, and Amazon S3 Cloud storage.

 

We have a door prize!  WIN A DELL - INSPIRON MINI NETBOOK WITH INTEL® ATOM™ PROCESSOR

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.