![]() |
|
Spaces home Scot's SharePoint StuffProfileFriendsBlogMore ![]() | ![]() |
Scot's SharePoint StuffThe good, the bad, and the ugly
|
||||||||||||
July 30 Creating a Scope and Tab for MOSS Search CenterI am occasionally asked how to create a tab in the MOSS Search Center to search a given scope. This process is often confusing to administrators because it involves the creation of a scope, making the scope available, and then the creation of not just one, but two tabs in Search Center along with ASPX pages. Before beginning, this article assumes that you already have the Shared Services Provider (SSP) properly set up and that you have a "Search Center with Tabs" site available in your portal. For my example, I'll create a tab designed to search a specific document library that contains HR documents. Note that this article does not cover creating an "Advanced Search" capability - just a simple keyword search. Create the Shared ScopeThe first step is to create a Shared Scope that will target the document library. This Shared Scope will be set up in the Shared Services Provider using the following steps:
When you have completed creating the scope and updating it, you should be able to see that it contains a number of documents. This is a good check that you have created the scope correctly and it contains the number of documents that you expect. Make the Shared Scope Available in the Site CollectionAn optional step is to make the new scope available to the site collection where the Search Center is located. Follow these steps to do that:
On the View Scopes page, you should see the new scope listed under the Unused Scopes section. At this point, you could easily add the scope to the Search Dropdown that appears at the top of the page in MOSS by clicking on the "Search Dropdown" link appearing in the "Display Group: Search Dropdown" section. However, our goal is to create a tab for the search scope. Create the Search Center TabNew tabs for Search Center involve several different parts. First, you must create a search page. Then you must create a search results page. Finally, you must associate the scope with the new pages and create tabs to display them. Follow these steps to get it all working:
Return to the Search Center home page and you should now see a new tab visible for HR Documents. Try out a search and verify the expected results. July 06 Is VSeWSS 1.2 Ready for Prime Time?Microsoft recently released Visual Studio Extensions for Windows SharePoint Services v1.2. As many of you know, I have been lukewarm about VSeWSS since its first release. I have written articles describing other development approaches including Ted Pattison's STSDEV tools, Andrew Connell's CodeRush toolset, and even my own development methodology. So I thought it was time to revisit VSeWSS given that this latest release finally works in Visual Studio 2008. My conclusion? Although VSeWSS continues to make progress, it just does not cover enough of the functionality professional SharePoint developers need. My detailed review follows.
Preparing the Development EnvironmentInstallation of VSeWSS v1.2 is simple. All you have to do is download the software onto your development machine (where VS2008 is located) and run the installation. As far as documentation goes, you can simply use the v1.1 documentation because v1.2 simply added VS2008 support whereas v1.1 was just for VS2005. When you start VS2008, you will find several new SharePoint projects available:
This set of projects has always been one of my first complaints about VSeWSS. When I create SharePoint solutions, I almost never create site definitions anymore. We used to create a lot of site definitions in the 2003 version of SharePoint, but in the 2007 version we have custom features. "Stapling" a custom feature to an existing site definition is the best practice - not creating new site definitions. So right away, you can see that there is no "Feature" project or "Staple" project. In my opinion, this gets people going in the wrong direction right off the bat. Later, you'll see that VSeWSS considers a "Feature" to be a packaging mechanism. I'm OK with this idea, but if you are new to SharePoint development, this set of projects is really misleading.
I do, of course, create a lot of list definitions and web parts for my solutions, so I like these projects. However, we're also missing Feature Receiver, Event Receiver, Custom Action, and Content Type projects. So for these, you just have to use the Empty project template and add items in later. While this may not be a big deal technically, I certainly wish they were all "first class" project types. My conclusion here is that 90% of the time, you'll simply start with an empty project template. This, as you'll see, can lead to difficulties.
Once you have a project opened, you can add several different items to it. These items represent many of the different solutions you'll want to build in SharePoint, but certainly not all of them. The set of project items represents a good start, and I am sure they will grow over subsequent releases. However, you still have to know how to create other types of items that may not be covered here such as a Feature Receivers.
Creating a SolutionFor my review, I simply tried to recreate the CentralAdminLink I demonstrated previously when discussing my own development methodology. This project does nothing more than add a link to the Site Actions menu to open the Central Administration site, but it allows us to exercise some of the basic development functions. This project only requires a Feature.xml file and an Elements.xml file with a CustomAction element. I found that VSeWSS had a difficult time handling this simple project because it was not based upon one of the pre-defined project templates.
In order to create my Elements.xml file, which contained the CustomAction definition, I had to create a blank project and add a Module item to the project. I was able to rename the Module item to "Elements.xml" and edit it by hand to create the CustomAction. Throughout this process, however, VSeWSS didn't do anything to help me create the CustomAction. The development effort was still primarily hand-coding XML files except now I had to constantly try and keep the project in sync with the toolset so that I could later build a WSP package for deployment.
After I got the Elements.xml file created, I was then able to switch to the WSP view to create the Feature.xml file. When I switched to this view, I was given a Manifest.xml and a Feature.xml file for free. Initially that seemed nice, but VSeWSS kept wanting to put an "Assemblies" entry in the Manifest.xml file so it could deploy the project DLL. The only problem, of course, is that this project has no assembly! My attempts to edit Manifest.xml were unsuccessful as the WSP builder kept putting the entry back. Ultimately, you can go to the file system directly and modify the structure, but I fail to see how this is easier than the other methodologies I have mentioned in this article.
When I built the project, VSeWSS did create my WSP file, but this file contained the assembly that I tried so hard to remove! Also, the deployment of the feature did not work because I had not used one of the built-in templates. In order to deploy the feature, I was forced to use STSADM commands by hand.
All-in-all, I think that this toolset will continue to mature, and I have no doubt that one day it will be the only toolset we need. Right now, however, I'd have to say that I'm sticking with my current approach. I would also strongly recommend that you learn how to create all of the possible SharePoint solutions before adopting this toolset because it does not support every one of them directly.
April 29 Troubleshooting SharePoint: When Good Servers Go BadThis article is a summary of my presentation at Office Connections held in Orlando April 30, 2008. It summarizes the most-common issues with SharePoint, how to avoid them, and how to fix them. Here is a list of topics:
Install Service Pack 1The first recommendation is to make sure that you have SP1 installed. SP1 has over 2500 fixes, and can go a long way to helping you avoid issues. Runaway Transaction LogsOne of the most common issues with SharePoint farms is runaway transaction logs associated with the SQL Server databases. This is really not a SharePoint issue, but a SQL Server issue. This issue is caused by the fact that most SharePoint databases are created in Full-Recovery mode. This means that SQL Server retains a log of every transaction that occurs on the database since the last database backup. If you never backup your SharePoint databases, then the transaction log will continue to grow until all the disk space is used up. Symptoms
RecoveryStep 1: Backup the Transaction Log manually from the UI. This will truncate the log, but not shrink it. From http://support.microsoft.com/kb/873235 When the transaction logs grow to an unacceptable limit, you must immediately back up your transaction log file. While the backup of your transaction log files is created, SQL Server automatically truncates the inactive part of the transaction log. The inactive part of the transaction log file contains the completed transactions, and therefore, the transaction log file is no longer used by SQL Server during the recovery process. SQL Server reuses this truncated, inactive space in the transaction log instead of permitting the transaction log to continue to grow and to use more space. Step 2: Manually shrink the log file from the UI. From http://support.microsoft.com/kb/873235 The backup operation does not reduce the log file size. To reduce the size of the transaction log file, you must shrink the transaction log file. To shrink a transaction log file to the requested size and to remove the unused pages, you must use the DBCC SHRINKFILE operation. The DBCC SHRINKFILE Transact-SQL statement can only shrink the inactive part inside the log file. PreventionOption 1: Switch to Simple recovery Mode for non-production SharePoint databases. This will prevent the transaction log from growing because simple recovery mode does not keep transaction history. Use the following SQL Statement: USE Master ALTER DATABASE [name] SET RECOVERY SIMPLE WITH NO_WAIT Option 2: Create a database maintenance plan for all SharePoint databases
Runaway SharePoint LogsAnother area where disk space can be used up quickly is through the SharePoint Unified Logging Service (ULS). The ULS writes text-file logs to the LOGS folder in the System Directory (\Program Files\Common Files\Microsoft Shared\web server extensions\12). SymptomsMany large text files located in the LOGS directory RecoveryDelete old files to regain space as necessary Prevention
Protected Memory ErrorsThis error shows itself as several different errors in the Event Log all saying that SharePoint attempted to read or write protected memory. Symptoms
Recovery & PreventionIISWAMREG Admin Service ErrorsSymptomsIn the Event Log, you see the following: Type: Error Recovery & Prevention
Here are some additional references: http://support.microsoft.com/kb/920783 http://blogs.vertigo.com/personal/steventap/Blog/Lists/Posts/Post.aspx?ID=21
Timer Job ErrorsThere are two timer services in SharePoint that are responsible for running various jobs that keep the farm healthy. If you have issues with these services, then you may see these jobs fail. Symptoms
Recovery
PreventionTo prevent these issues, create a batch file that periodically recycles the services.
Update ConflictsWhenever you update SharePoint system passwords, you can have issues with SharePoint being able to access databases and run jobs. SymptomsIn the Event Log, you see the following error: An update conflict has occurred, and you must re-try this action. The object SPApplicationPool Name=SharePoint Central Administration v3 Parent=SPWebService Name=WSS_Administration is being updated by {...}, in the STSADM process, on machine {...}. View the tracing log for more information about the conflict. Recovery & PreventionClear the File System cache on the SharePoint front end servers using this procedure: (From http://support.microsoft.com/kb/939308).
Here's a great article on password changes for SharePoint: http://blogs.msdn.com/joelo/archive/2006/08/22/712945.aspx
Performance IssuesVarious performance issues like slow page loads. Symptoms
Recovery
Prevention
<BlobCache location="C:\blobCache" path="\.(gif|jpg|png|css|js)$" maxSize="10" enabled="true" /> Customization ErrorsSymptoms
Recovery
<compilation batch="false" debug="true"> <customErrors mode="Off" /> <SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false"> Prevention
Security ErrorsSymptomsRequest for the permission of type 'Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' failed RecoveryAdjust security policy in web.config file as follows: <trust level="WSS_Medium" originUrl="" /> PreventionImplement custom security policies on all web parts. Start with Dan Larson's blog entry on the topic. April 27 Making Excel Services and Excel Work Better TogetherI just completed an MSDN article that focuses on making the Excel Services experience more like the Excel client experience when importing two-dimensional data for analysis. The idea was to provide similar capabilities in Excel Services for importing, analyzing, and displaying imported data. If you're looking to use Excel Services as a reporting platform or as the basis for dashboards, check out this article. April 03 Disposing SPWeb and SPSiteRead this great article by Roger Lamb and become a better SharePoint developer.
Thanks for visiting! |
|
|||||||||||
|
|