10/13/2008

SharePoint: "Service Unavailable"

When you open a browser and navigate to a SharePoint site and get "Service Unavailable" this is usually due to a bad application pool account: wrong account, expired, bad password etc. I found a new cause... MOSS evaluation copy has expired! I got this error trying to run a quick demo on a VPC I had not used for a while. I then wasted a lot time exploring the accounts, changing passwords etc. Then it dawned on me that this VPC may have been built with an evaluation copy of SharePoint. Sure enough... set the date back on the PC and all works fine. Now off to use my correct VPC... For other causes just Goggle "SharePoint Service Unavailable".

7/23/2008

SQL: Sample CLR function for a Regular Expression validation

 

Here is a quick example of a .net CLR function to validate any string value using a regular expression. (only works with SQL 2005 and later of course)

1) create a new project using the C# or VB "SQL Server Project" template

2) add a New Item - a function

3) add this code!

using System;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using Microsoft.SqlServer.Server;
using System.Text.RegularExpressions;

public partial class UserDefinedFunctions
{
    [Microsoft.SqlServer.Server.SqlFunction]
    public static SqlBoolean RegExpression(string strToTest, string regExpression)
    {
        return Regex.IsMatch(strToTest,regExpression);
    }
};

4) Deploy and test!

 

Samples of how to call:

Test a phone number:

print dbo.RegExpression('223-123-1234','^[2-9]\d{2}-\d{3}-\d{4}$')

Test an email address:

print dbo.RegExpression('abc@maxtrain.com', '^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$')

 

Test a column of phone numbers:

use AdventureWorks
select phone, dbo.RegExpression(phone,'^[2-9]\d{2}-\d{3}-\d{4}$') as validphone  from person.contact

7/19/2008

SharePoint: All about Features - Editing Tips

This article is one of a series. See All about Features! for more.

 

Tips for editing Features

Features are defined using XML. You can use any editor, but likely candidates include Notepad, Visual Studio, SharePoint Designer and any other XML editor. To edit XML with some form of Intellisense requires an XML schema. SharePoint supplies one named WSS.XSD and it can be found in:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML\wss.xsd

The wss.xsd schema defines: Feature, Elements, List, Project and Solution.

In many XML editors you register the schema in the editor and then list the schema in the XML tag:
<Feature  xmlns="http://schemas.microsoft.com/sharepoint/">
</Feature>

In Visual Studio you can enter the path to the schema file in the Schemas property of the document. Once the editor knows the schema you should get syntax help from your XML editor.

 

Back to All about Features! for more.

SharePoint: All about Features

 

All about Features!

All? Not really... Features are one of SharePoint's Swiss Army Knives, something for everybody...

So where to start? Here's a list of topics... the ones that are links are finished and the others will be done one of these days!

  • Tips for editing Features
  • The feature.xml file
  • The elements.xml file
  • How to deploy a Feature
  • Features to add menu items to SharePoint
  • Features to remove items from SharePoint
  • Features to add custom controls (using SharePoint Delagate controls)
  • Features to run custom .Net code
  • Features to deploy files

6/24/2008

SharePoint: Calculated Column Notes

A few misc. notes on SharePoint calculated columns. Calculated columns cannot reference Lookup columns. Samples of Calculated Field Formulas http://msdn.microsoft.com/en-us/library/bb862071.aspx Bottom line? Look for Excel style functions, not VB Script functions. For example, use FIND, not INSTR to find the position of one string inside of another.

5/07/2008

SharePoint: Create a What's New web part for a library or list (with no programming!)

Using Sort, Limit and Expand Folders is a great way create a "what's new" web part.
  1. Add a web part to the page for the list or library
  2. From the web part's dropdown menu select "Modify Shared Web Part" and from the properties panel click the "Edit the current view" (just below the "Selected View" dropdown)
  3. In the Sort section select "Modified" and "descending"
  4. Expand Folders and select "Show all items without folders" to show all of the documents in the library in a single list
  5. Expand "Item Limit" and enter the number of items to display
  6. Optionally select what to do if there are more than that number of items:
    • select "Display items in batches" so the users can click next / previous links to page through the data, or
    • select "Limit" to display just xx number of items and then display a More link to take the user to the library's page
  7. Click OK to save the view and click OK to update the web part.

4/12/2008

SharePoint: Turn on more accessible mode???

Try this!

  • Go to a SharePoint page using a default master page, your own or a site such as http://www.wssdemo.com/.
  • Click as close to the top left corner of the page as possible (just in front of the crumb trail)
  • Press Tab - you should now see "Turn off more accessible mode" (if this is does not work, experiment with several tabs or shift-tabs)

What this is supposed to do is change how some navigation controls work. For example, if you are on your own site that has a Welcome menu, click the menu. Instead of a dropdown you will get a new window with all of the choices displayed. If you are testing this with the WSSDEMO site then display a page with a list or library that has an Action menu. Then turn "more accessible" on and click the Action menu. (you may get a warning from your popup blocker)

For more information on accessibility see: Microsoft Active Accessibility (MSAA).

For a great blog article on MOSS accessibility go here: http://www.21apps.com/2007/03/sharepoint-accessibility-is-moss-2007_4974.html

4/02/2008

SharePoint: Web part for a document library folder?

The following is one way to display the folder from a SharePoint library as a web part. While there are other approaches, the goal of the following approach to create this folder display with no code, no custom web parts, no access to the servers and no custom XML or HTML. This approach uses SharePoint Designer to create a new page with a single web part to display the folder. The challenge is not the web part, but displaying just a single folder out of the list. Once the new page has been created you can navigate to the folder and the copy the URL for this page and then use it to display the page in a Page Viewer web part. It of course would be ideal if the library's web part properties included a way to filter by URL or folder.

 

Create a View

  • Go to your document library (Example: Shared Documents)
  • Click Settings menu and select Create View
  • Click Standard View
  • Give the view a name (Example: Folder View)
  • Pick the columns to display - Type (icon linked to document) - Name (linked to document with edit menu)
  • Limit the number of items displayed by expanding "Item Limit" (Example: 10)
  • Click OK to create the view
Add a web part so we can have something to copy to our new page
  • Click Site Actions and Edit Page
  • Click Add a Web Part
  • Add the web part for your library (Example: Shared Documents)
  • From the web part's Edit menu select Modify Shared Web Part
  • Make these changes:
    • Select your newly created view
    • Change the Toolbar Type to None (unless you want the tool bar displayed - for exmple, to allow uploads)
    • Expand Appearance and
    • change Chrome Type to None
  • Click OK
Create the page to display the list
  • Open SharePoint Designer and open your site
  • Scroll down and double-click default.aspx to open your home page - make sure you are displaying the page in Design view (tabs at the bottom of the edit screen)
  • Click the web part that's displaying your new view, right-click and select Copy
  • Click File, New and select ASPX page
  • Rename the page to a useful name such as SharedDocumentsFolderView.aspx
  • Double-click the new page to open it in the editor - make sure you are displaying the page in Design view (tabs at the bottom of the edit screen)
  • Click in the form box and then right-click and select Paste
  • Click File, Save (you can close SharePoint Designer now)
Get the URL to the folder
  • Open a new browser and navigation to the new page. Probably something like: http://moss.litwareinc.com/sites/testsite/SharedDocumentsFolderView.aspx
  • Click on the folder you want displayed. The URL will now look something like:
    http://moss.litwareinc.com/sites/testsite/SharedDocumentsFolderView.aspx?RootFolder=%2fsites%2ftest%2fShared%20Documents%2fsub1 &FolderCTID=&View=%7bE0AECBEA%2d20BB%2d4BC3%2d98BC%2dE65D4ADB9DB1%7d
  • Copy this URL
Add the web part to your home page
  • Return to a browser and display your web site's home page
  • Click Site Actions and Edit Page
  • Delete the web part you added earlier for your library
  • Click Add a Web Part
  • Add the Page Viewer web part
  • From this web part click Edit Shared Web Part
  • Paste the URL to your new custom page in the Link box
  • Change any other properties needed. Most likely are:
    • Appearance -> Title Appearance -> Chrome Type
    • Appearance -> Height Appearance -> Width
    • Advanced -> Title Url (most likely a link to the full library)
    • Advanced -> Description
  • Click OK

3/28/2008

SharePoint: Site Collection Administrator vs Site Owner (Full Control)

Updated 6/24/09

 

The words “administrator” and “owner” are a problem in SharePoint due to multiple “official” and “common” uses.

  • SharePoint Server (system?) Administrator – responsible for the physical servers, software installation, backup, etc.
  • SharePoint Site Collection Administrator – the user responsible for the entire site collection, has access to Site Collection wide features in several places including Site Settings, typically is the person responsible for a department or a group’s entire site collection.
  • SharePoint Site Owner – a user with “full control” rights to a single site, it’s lists, libraries and content, and any sub sites and workspaces created below it.  I.e. responsible for a “branch” of a site collection. 

Here's a list of what the Site Collection Administrator can see that the Site Owner (Full Control user) can not:

Site Actions -> Site Settings

-- Users and Permissions

---- Site collection administrators (only an option when at a top level site)

-- Galleries
---- Workflows

-- Site Administration
---- Content and structure logs

-- The entire Site Collection Administration column is missing
(which also means that the full control user can't access the 2nd level Recycle Bin)


And interestingly enough... we don't trust the Full Control user with all of these features, but they can delete the site!

 

Here’s the Site Actions –> Site Settings screens…

 

For the Site Collection Administrator, at a top level site:

(Circled items are not available to the Site Owner)

image

 

For the Site Owner, at a top level site:

image

 

For the Site Owner, at a sub site you will be missing “Save site as template” and many of the Galleries items:

image

 

For sub sites both the Site Collection Administrator and the Site Owner the Galleries column is reduced to these choices.

image

 

Also, the “Site collection administrators” link is only available at the top level site.

image

 

.

3/24/2008

SharePoint Articles

 

I have been a bit slow updating this index page, so you may want to take a look at the RSS feed to find the most recent articles:  http://feeds2.feedburner.com/TechTrainingNotes



User Group? Cincinnati SharePoint User Group

 


Articles and links for:


And for everyone:


For Site Owners and Site Collection Administrators 


How To's and Tips My (old) collections of web resource links

For Server Admins



How To's and Tips
Other SharePoint Tools and Add-Ins
My collections of web resource links

For Developers


How To's and Tips
My collections of web resource links


For Customizers 

How To's and Tips





Old Stuff:

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.