Showing posts with label MOSS. Show all posts
Showing posts with label MOSS. Show all posts

Wednesday, January 5, 2011

SP 2010: Create New Web Application and Site Collection

Create New Web Application

IIS Web Site
  1. Description: MOSS Web App - 80 (Consider TurtlePoint Web App - 80)
  2. Port: 80
Application Pool
  1. App Pool Name: MOSS Web App - 80 (Consider TurtlePoint Web App - 80)
  2. Account: spAppPool
Database Name and Authentication
  1. DB Name: MOSS_WebApp_Content
MOSS_WebApp_Content DB created
MOSS Web App Web - 80 Site created
MOSS Web App - 80 App Pool created



Create New Site Collection

Title and Description
  1. Title: Turtle Point
Template Selection
  1. Collaboration > Blank Site
  2. Activate these Site Collection Features
    1. SharePoint Server Enterprise Site Collection
    2. SharePoint Server Publishing Infrastructure
    3. SharePoint Server Standard Site Collection
    4. Publishing Approval Workflow if desired
  3. Activate these Site Features
    1. SharePoint Server Enterprise Site
    2. SharePoint Server Publishing
    3. SharePoint Server Standard Site
    4. Team Collaboration Lists
Primary Site Collection Administrator
  1. TURTLELLC\Administrator
No new database, web site or app pool created

Wednesday, December 22, 2010

Building a Search Center

To build a Search Center create a new site, selecting Enterprise > Search Center with Tabs.

Once the site is built, configure the following items:
  1. Search scopes
  2. Search pages
  3. Search tabs
  4. Results pages
  5. Assign scopes to result pages
  6. Results tabs
  7. Advanced Search Pages
Create a Search Scope

Scopes can be created either at the Site Collection level using SharePoint Central Administrator or at the Site Collection thru Site Actions > Site Settings > Search Scopes.

If you need to narrow a scope down to folder level, then use the Site Actions > Site Settings approach. If your scopes are broader and can be handled with Content Sources and Metadata Properties then use the SharePoint Central Administration approach.

Create a New Search Page
  1. From the Search Center
  2. Site Actions
  3. Create Page
  4. Enter a Title, Description and change the URL if desired
  5. Select (Welcome Page) Search Page
  6. Click Create
Create a New Search Tab
  1. Edit the new search page just created
  2. Click Add New Tab
  3. Enter a name for the tab
  4. Specify the name for the search page just created (ex. MySearchPage.aspx)
  5. Enter a tooltip
  6. Click OK
Create a New Results Page

Search pages and tabs work in pairs, for every search page, there must be a matching results page and for every search tab, there must be a matching results tab. A unique results page allows the assignment of unique scopes to a search.
  1. From the Search Center
  2. Site Actions
  3. Create Page
  4. Enter a Title, Description and change the URL if desired
  5. Select (Welcome Page) Search Page Results
  6. Click Create
  7. Edit the new page
  8. On the Search Box > Modify Shared Web Part
  9. Expand Miscellaneous
  10. Enter the name of the new search page created above in 'Target search results page URL"
  11. Note you will come back after creating the Advanced Search page, to enter it's URL in the "Advanced Search page URL"
  12. Click Apply
Assign Scopes to Result Page
  1. Continue editing the new results page
  2. On the Search Core Results web part > Modify Shared Web Part
  3. Expand Miscellaneous
  4. Enter the name of the Search Scope created above.
  5. Click Apply
Create a New Results Tab
  1. Still editing the new results page just created
  2. Click Add New Tab
  3. Enter a name for the tab
  4. Specify the name for the search page just created (ex. MySearchPageResults.aspx)
  5. Enter a tooltip
  6. Click OK
Create an Advanced Search Page
  1. Navigate back to the initial Search Center so you are not looking at a results page
  2. Site Actions > Create Page
  3. Enter a Title, Description and change the URL if desired
  4. Select (Welcome Page) Advanced Search
  5. Click Create
  6. Click Add a Web Part
  7. Check 'Advanced Search Box'
  8. Click Add
  9. On the 'Advanced Search Box' > Modify Shared Web Part
  10. Expand Scopes
  11. Check 'Show the scope picker'
  12. Change the 'Display Group' to the correct one
  13. Click OK
  14. Edit the New Results Page previously created
  15. On the Search Box > Modify Shared Web Part
  16. Expand Miscellaneous
  17. Enter the name of the advanced search page created in 'Advanced Search page URL". Be sure to include the entire path.
  18. Click Apply
  19. Edit the New Search Page previously created
  20. On the Search Box > Modify Shared Web Part
  21. Expand Miscellaneous
  22. Enter the name of the advanced search page created in 'Advanced Search page URL". Be sure to include the entire path.
  23. Click Apply
Be sure the check-in and publish all new and edited pages.

Wednesday, August 18, 2010

Hiding Edit in Datasheet, Export to Spreadsheet and Open with Access Menu Items

To hide the Edit in Datasheet, Export to Spreadsheet and Open with Access menu items. Create a custom Permission Level using the directions found here.

When specifying the permissions for the custom Permission Level make sure Use Client Integration Features is unchecked, this will prevent users from launching client applications which includes Access embedded in the datasheet, as well as the external applications. Unchecking Use Remote Interfaces is probably a safe bet as well.

Creating Custom Permission Levels

Frustrated by the limit of existing Permission Levels within SharePoint (Full Control, Design, Approve, Contribute, Read, etc.) I finally discovered how to create my own. These are created at the Site level like this:
  1. Site Actions > Site Settings > Advanced Permissions
  2. Settings > Permission Levels
  3. Add a Permission Level
  4. Enter a Name and a Description
  5. Select permissions from the beautiful buffet of security settings are available
  6. Click Create
At this point the new Permission Level is available when assigning permissions to a user or group!

Thursday, July 29, 2010

The Perfect SharePoint Document Template

SharePoint is a good Document Management System until you need to embed properties within a document. Once properties are embedded they won't update until you print, you manually update the fields or you add a macro to update them every time the document is opened.

SharePoint as a Document Management System also falls down when you want to update the template used by documents and have that update affect all existing documents.

The Perfect Document Template

The perfect template will have a macro that updates embedded SharePoint properties whenever a document is opened. And the template will allow me to change the header and footer for all the documents whenever I want. To do this, I need a template that I can swap out whenever I want.

Because of the default behaviour of SharePoint and Word, the template is downloaded once when you open a document. The template is never pulled again from SharePoint. See this reference. This means any updates you make to the template do not pass down to you.

The article refered to from Microsoft above discusses building an XML Expansion Pack, which is overkill for what I need. And in fact doesn't work with MOSS only WSS.

The simpler solution is to build 2 templates: a driver template and an actual template.

The Driver Template

This is the template that is bound to the Content Type and is the one that gets downloaded and never updated. What this template does is binds the actual template you want to associate with the actual document.

The Actual Template

This template contains code to dynamically build the header and footer and update all the embedded properties.

To Build This Solution
  1. Define your Document Library
  2. Define your Content Type
  3. Create a Driver Template in the Forms directory of your Document Library
  4. Create an Actual Template in the Forms directory as well
  5. Bind the Driver Template to the Content Type
  6. Test
I won't bother showing you how to create a Document Library or defining a Content Type, but I will show you steps 3 and 4.

Create a Driver Template

Open MS Word.
Alt + F8 will take you to macros
Create a macro called UpdateTemplate
Once you are in Visual Basic, paste this code in the code window:

Private Sub Document_New()

'temporarily unlink this file from the template
ActiveDocument.AttachedTemplate = ""

'and update
UpdateTemplate

End Sub

Sub UpdateTemplate()

Dim strTemplatePath As String
Dim doc As Document

' Get the path of the template file.
strTemplatePath = "http://sharepoint-test/Docs/MyLibrary/Forms/ActualTemplate.dotm"

' Open the document template and save it to the local machine
Set doc = Application.Documents.Open(strTemplatePath, Visible:=False)
doc.SaveAs Environ("Temp") & "\ActualTemplate.dotm"
doc.Close

' Add the template as an Add-in
Application.AddIns.Add Environ("Temp") & "\ActualTemplate.dotm"

' Run the macro in the ActualTemplate template
Application.Run "UpdateThisDocument"

' Rest of the lines do not execute.
Application.AddIns.Unload True
On Error Resume Next 'In case another document is using the template
Kill Environ("Temp") & "\ActualTemplate.dotm"

ActiveDocument.AttachedTemplate = strTemplatePath

End Sub

Private Sub Document_Open()

'do not do anything in the case where the solution author opens the template directly
If (InStr(1, ActiveDocument.FullName, ".dotm", vbTextCompare) = 0) Then

'temporarily unlink this file from the template
ActiveDocument.AttachedTemplate = ""

'update template
UpdateTemplate

End If

End Sub

Close the VB environment and save your template.

NOTE: Make sure to save it as a .dotm (macro enabled template)

Create an Actual Template

Open MS Word.
Alt + F8 will take you to macros
Create a macro called UpdateThisDocument
Once you are in Visual Basic, paste this code in the code window:


Sub Document_New()

End Sub

Sub Document_Open()

UpdateThisDocument

End Sub

Public Sub UpdateThisDocument()

Application.ScreenUpdating = False

Margins

'Header
ClearHeaders
AddHeader

'Footer
ClearFooters
AddFooter

'Update Fields
UpdateFields

'Display Document Normally
If ActiveDocument.ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveDocument.ActiveWindow.View.Type = wdPrintView
ActiveDocument.ActiveWindow.View.SeekView = wdSeekMainDocument
ActiveDocument.ActiveWindow.View.Type = wdPrintView
End If

End Sub

Private Sub Margins()

With ActiveDocument.Styles(wdStyleNormal).Font
If .NameFarEast = .NameAscii Then
.NameAscii = ""
End If
.NameFarEast = ""
End With
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.TopMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.7)
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.4)
.FooterDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.BookFoldPrinting = False
.BookFoldRevPrinting = False
.BookFoldPrintingSheets = 1
.GutterPos = wdGutterPosLeft
End With

End Sub

Private Sub ClearHeaders()
Dim hdr As HeaderFooter

For Each hdr In ActiveDocument.Sections(1).Headers
hdr.Range.Text = vbNullString
Next hdr

End Sub

Private Sub AddHeader()

'
'TODO: Add your header code here
'

End Sub

Private Sub ClearFooters()
Dim hdr As HeaderFooter

For Each hdr In ActiveDocument.Sections(1).Footers
hdr.Range.Text = vbNullString
Next hdr

End Sub

Private Sub AddFooter()

'
'TODO: Add your footer code here
'

End Sub

Private Sub UpdateFields()

With Options
.UpdateFieldsAtPrint = True
.UpdateLinksAtPrint = True
End With

If ActiveDocument.ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveDocument.ActiveWindow.Panes(2).Close
End If

ActiveDocument.ActiveWindow.View = wdNormalView

'Application.ScreenUpdating = False

If ActiveDocument.ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveDocument.ActiveWindow.ActivePane.View.Type = wdOutlineView Then
ActiveDocument.ActiveWindow.ActivePane.View.Type = wdPrintView
End If

'Footer
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekPrimaryFooter
Selection.WholeStory
Selection.Fields.Update

'Main Document
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Selection.WholeStory
Selection.Fields.Update

'Header
ActiveDocument.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.WholeStory
Selection.Fields.Update

End Sub

Close the VB environment and again save your template as a .dotm file.

Bind the Driver Template to the Content Type

Go to your Document Library
Settings > Document Library Settings
Under Content Types, click on your Content Type
Click Advanced Settings
Enter the URL for the DriverTemplate.dotm (http://sharepoint-test/Docs/MyLibrary/Forms/DriverTemplate.dotm)
Click OK

Test

In the Document Library, click New and select your Content Type.
At this point your macro code in ActualTemplate.dotm should have fired. Any header or footer creation should have occurred.


Monday, November 16, 2009

SharePoint Document Property Names

Recently while working on embedding SharePoint properties within a Word 2003 document I discovered some oddities with the names. When working to embed a property named Doc No. I found at times one of the 3 following situations displayed in the Field list:
  1. Doc No.
  2. Doc No. and Document No.
  3. Document No.
If i used Doc No. the value would be incorrect. If I used Document No. the correct value would display and would synchronize.

Upon investigation I looked at the AllLists table in the database to find the row for the Document Library I was using. Examining the ContentType column explained the behaviour. For the field Doc No. this is the value I found:

DisplayName="Doc No."
Required="TRUE" Hidden="FALSE"
ReadOnly="FALSE" PITarget="" PrimaryPITarget=""
PIAttribute="" PrimaryPIAttribute=""
Aggregation="" Node=""/>


Notice that the name is Document No. (after decoding) and the DisplayName is Doc No. After seeing this, I remembered initially naming the column Document No. and then shortening it to Doc No. SharePoint obviously retained the original name as the ID of the field and just adds the DisplayName attribute to show the changed value. This is definitely a gotcha and will lead to some confusion for users. But at least the behaviour is now explained.

Monday, October 19, 2009

Documents Not Appearing in Search Results

I recently spent quite some time trying to understand why certain documents would appear in my search results, and others wouldn't.

I looked at the 'Always index all ASPX pages on this site' setting found at Site Settings > Search Visibility. But that didn't resolve the issue.

I looked at the 'Allow items from this document library to appear in search results?' setting found at Document Library Settings > Advanced Settings. But that didn't resolve the issue.

Finally I noticed that documents that appear in the search results have a major version (1.1) and the documents that do not appear, only have a minor version (0.1). So I published one of the documents, did an incremental crawl, and the document began appearing in the search results.

One mystery solved today.

Wednesday, October 14, 2009

Causing the Create Site link to Create a Site Collection

If you layout your MOSS intranet with the multiple Site Collections approach, you can simplify the creation of new Site Collections.

There are a couple settings which need to be setup for this to work:

Central Administration

  1. Central Administration > Application Management
  2. Under the Application Security section click on Self-service site management
  3. Turn, 'Enable Self-Service Site Creation' on
  4. It is optional to require a secondary contact in this form
  5. Click OK

Site Directory

  1. From within the site directory of the web application, go to Site Settings > Modify All Site Settings
  2. Under the "Site Collection Administration" area, click on "go to top-level site settings"
  3. Under the same "Site Collection administration" area, click "Site Directory Settings"
  4. Check '
  5. Click OK
Now when you are the Site Directory, clicking the Create Site link, will create a Site Collection.

Thanks to Dave Wollerman for this tip.

Tuesday, September 29, 2009

Open Links in New Window

Ricky Spears has a great post on opening SharePoint links in a new window. Once again the Content Editor Web Part and javascript to the rescue.

Wednesday, September 23, 2009

Widening (Fixing) the Tree View for Document Libraries

I find the Tree View a beautiful idea which leaves users unsatisfied. It is too narrow to be very functional. Using SharePoint Designer and a custom Master Page it is quite easy to fix this problem. So take a minute and follow along.

Master Page

You will need a custom Master Page, so if you have one, skip to the Tree View below. If you need to create one, Greg Galipeau does a great job explaining how to create a Master Page here. So take some time to read, understand and create your own custom Master Page. Then move on to the Tree View section below.

Tree View

To change the width of the Tree View follow these few simple steps:
  1. Using SharePoint Designer open your site.
  2. Then open your custom Master Page by navigating in the Folder List to _catalogs > masterpage > customMasterPage.master
  3. Find the SharePoint:SPRememberScroll tag.
  4. Change the width from 150px to 200px or your preference.
  5. Click the save button.
  6. Refresh your SharePoint page
Voila the Tree View becomes wider and more useful.

Wednesday, April 1, 2009

Recipe for Moving a WSS Site to Its MOSS Site Collection

I recently had to move a bunch of WSS Sites to individual MOSS Site Collections, here is the recipe I used:
  1. Backup MOSS - create a snapshot to rollback to if necessary
  2. Export old WSS Site
    1. stsadm -o export -url http://OldWSSSiteCollection/OldSite -filename C:\Temp\Exports\Sites\OldSite.bak -overwrite -includeusersecurity -haltonfatalerror -versions 4 -nofilecompression
  3. Manually create the new MOSS Site Collection. Keep in mind it must use the same template as the original site. So if your original Site used the Blank template, then you must use the Blank template.
  4. Import old WSS Site into new MOSS Site Collection
    1. stsadm -o import -url http://NewMOSSnoblepoint/sites/NewSite -filename D:\MOSS Backup\Exports\Sites\OldSite.bak -includeusersecurity -haltonfatalerror -updateversions 2 -nofilecompression
  5. Test Site for navigation and content
  6. Change Top Site link
  7. Fix any workflow issues
NOTE: Alerts have to be recreated after this process.
Steve Smith provides an excellent article on configuring Email Enabled Libraries in MOSS 2007 using Exchange 2003: http://www.combined-knowledge.com/Downloads/Moss07incoming_e-mail.pdf

Moving Databases

For some reason pointing SharePoint to a different database server requires the renameserver command for stsadm. Here is a link: http://technet.microsoft.com/en-us/library/cc512725.aspx

MOSS Tidbits

  • MOSS = SharePoint Portal Server and MOSS Enterprise/Standard = SPS Enterprise/Standard
  • stsadm.blogspot.com contains an stsadm extension
  • www.codeplex.com is MS's Open Source site containing projects for most MS technologies including SharePoint
  • SharePoint Page
    • Master Page in SharePoint contains the top and side navigation.
    • The content section of a SharePoint page is different than the Master Page.
    • At least conceptually, there is a class interface for a SharePoint page. This interface must have all of its requirements implemented. How you do this is irelevant, allowing you to use SP Designer or even some other tool to create a page that will run in SharePoint.
  • http://www.microsoft.com/sharepoint/learning/help.mspx is a site for SharePoint Training
  • Forefront - a Microsoft product that scans documents before going into a Document Library to verify they don't contain viruses.
  • www.microsoft.com/office may contain some eLearning for SharePoint

Workflow Tools Beyond Visual Studio, SPD and Out of the Box Workflows

  • Documentum
  • Nintex (SharePoint integraged)
  • K2
  • Blue Spring Software (I am told this one works well with SharePoint)

MOSS Service Accounts

These are the various service accounts used when setting up a new two server MOSS installation
  1. spSql
    1. This account is used by MOSS to access the databases. Additionally, it is used as the identity for the Central Administration application pool & the WSS Timer service.
  2. spSearch
    1. This account is utilized by all of the Shared Service Provider to crawl local & remote content.
  3. spAppPool
    1. Use this for all Application Pool accounts
  4. spSsp
    1. This account is used for the SSP web services & the SSP timer jobs.
  5. spContentAccess
    1. The default account for crawling content
Thanks to Chris Regan and his blog posting on MOSS Setup / Service Accounts for helping me understand how things work a little better.

Tuesday, March 17, 2009

Detaching and Reattaching a Content Database

Detach

The easiest way to detach a content database is thru the UI in Central Administration.
Central Administration -> Application Management -> Content Databases
Click on the link for the Content Database you want to detach. Make a note of the name of the database. Check the 'Remove content database' checkbox. Click OK. This removes but does not delete the database.

Attach

If the Content database is larger, then attaching it is best done using stsadm. Login to the SharePoint server. Bring up a cmd window. Run the following command: stsadm -o addcontentdb -url [url] -databasename [database name]

You can also attach smaller databases using the UI in Central Administration.

Central Administration -> Application Management -> Content Databases

Click 'Add a content database'. Specify the database name you jotted down when detaching. Click OK.

Thursday, March 12, 2009

Configure SMTP for MOSS on Windows Server 2008

To configure SMTP for MOSS on Windows Server 2008 do the following:

Windows Server 2008 Configuration

  1. Add the SMTP Server Feature if required.
  2. Specify an E-mail address
  3. Use the 'Deliver e-mail to SMTP server' option
  4. Set SMTP Server to your Exchange server
  5. Click Apply

MOSS Configuration

  1. Central Administration -> Operations -> Incoming E-Mail Settings
  2. Enable sites on the server to receive e-mail
  3. Settings mode: Automatic
  4. SharePoint Directory Management Server: No
  5. E-mail server display address: Accept default
  6. Accept mail from all e-mail servers.

Email is written to various C:\Inetpub\mailroot\ folders during the life of an email transmission. You may be able to use these folders for troubleshooting.