Ramblings of the constant presence of Gates in my life RSS 2.0
 Wednesday, June 27, 2007
We just finished an upgrad of a customer SharePoint environment from 2003 to MOSS 2007. The upgrade went rather smootly through the first little bit, then blew chunks, then (after three hours with MS) was completed and working (covered in another post - link to come).
 
Now the little quirky thinkgs start coming in from the customer. For instance, "our alerts aren't working anymore". Well, why the heck not? They look like they are all set in the list just the way they should be. I even deleted one (from the Site Settings pages) and recreated it. Still no go.
 
I create a new site and added an alert to the default announcement list, and it worked! Ok, so all the resets of the timer and admin service finally worked. "Customer, you should be good; I just received an Alert." And, of course, the response from the customer, "still not working for me on my site."
 
By now I have already read through MANY posts, one of which (link coming later) is a Microsoft KB article with a good script in it. Only problem is, I really don't like writing console apps and not being exactly sure of what the script really is doing. The explanation isn't quite full enough for me. Then I saw a couple of folks mention the good ole "ImmedSubscriptions" and "SchedSubstcription" tables. So, they want me to clear these out and recreate my alerts. Um, how about NO!!! I am not about to ask hundreds of users to rebuild hundreds of alerts because something weird is going on in my SharePoint site after my upgrade.
 
I opened up the tables and noticed there were two different values showing up in the SiteURL field. One was the correct URL with the other being a very slightly different URL. So, I ran a simple update on each table and HERE COME THE ALERTS!!! Yea!
 
Asked the customer, "did you guys rename this site prior to our doing the upgrade?"
 
Customer responds: "Oh yeah, we took the hyphen out of the URL right before you guys came in."
 
And there ya go, the alerts actually weren't working PRIOR to our upgrade process, but we didn't have all the information of what had happened prior to our service starting. So, could have saved myself a good bit of effort probably, but lesson learned (and shared).
Wednesday, June 27, 2007 8:22:06 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: Bugs | SharePoint

The customer says "we used to be able to overwrite attachments", but it would appear that is no longer the case after an upgrade to MOSS 2007 and WSS 3. Well, come to find out that indeed attachments are opened in Word or Excel as Read-only no matter what you do (unless maybe you are the site collection owner).

What we found was that the customer had Office 2003 loaded up everywhere. We (myself and my co-worker) tested this on our own machine, and yes, it did open as read-only. Strange though, we could still save the file back to the item attachments and overwrite the current attachment item with our changes.
 
So, even though Office claims that the attachment is read-only, it lied! We could make all of our changes, click the save button and then just click the one extra OK/Save button.
 
Still, this didn't fix the problem for the customer. They were not able to do this. After looking a little further we found that our machines were loaded with Office 2003 SP2, but the customer systems had not yet been updated to this service pack. I tested it out on one of their boxes, and wouldn't you know, opens read-only, but saves right over top of the current attachments. Finally, they don't have the "copy of copy of copy of " myfilename attachments anymore.
Wednesday, June 27, 2007 8:19:26 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: SharePoint | Bugs
 Sunday, June 10, 2007
Funny thing I noticed while building a rather simple data form. The page is just a single grid view and a form view control for adding new records to an ObjectDataSource tied to my Business logic class. My business class is on top of a basic Typed Dataset. The underlying table has an Identity field (auto number) and a couple of other fields.
 
When I tested my Insert query in the dataset designer, it worked like a champ (and didn't require me to pass the ID, duh). But, when I tried to add a new record via the formView it kept bombing telling me the ID field could not be null! Why the heck not?! It has to be null since the DB sets it for me on the insert. Needless to say I was a little ticked about this.
 
I pulled up my little Add method in my Business class and, just for the heck of it, added a line to set the ID field to a value of 0. Well, wouldn't you know it, it worked. Good news was that the new record did indeed increment as it should have and wasn't set to 0. So, all working now. Still not sure why the dataset isn't smart enough to know it can run the insert without having that value assisgned though. Oh well.
Sunday, June 10, 2007 8:23:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: Bugs | .NET Dev
 Friday, June 08, 2007
Custom Search Bombs in Extranet or Internet zones (or any zone not deemed default)
 
One of the customization we are working on is a search tool that returns ALL items whether you have permissions to it or not. So, clearly we just add impersonation and then use the KeywordQuery. Good, good, all is fine.
 
Then we tried the tool in our Internet zone instead of our default zone. The setup is this:

Intranet/Default: corp.testingzonesInSharePoint.com using AD for auth
Internet (external): www.testingzonesInSharePoint.com   using Forms auth
 
I will rant on the dual auth thing later!
 
Problem:
Running in the www zone returned results with no trouble except that each item was returned with the default zone URL. Sometimes this might not matter, but for us, this meant that the user was going to have to login again if they clicked that item. Not so good.
 
Solutions:
To get around this I found out there is a little known (read undocumented - dang MSDN) property that needs to be set to ensure the context stays in the right zone. I would have thought this would be automatic, but evidentally not. So, here ya go!
Dim thisSite As SPSite = New SPSite(mySiteURL)
Dim myQuery As KeywordQuery = New KeywordQuery(thisSite) 'would think that would do it, right?
Dim strQuery As String = "author: some cool guy"
myQuery.QueryText = strQuery
          
'and here is the fix
dim curSite as spsite = SPControl.GetContextSite(HttpContext.Current)
myQuery.SiteContext = New Uri(curSite.Url)
'uses the correct Zone
 
'now let's get the results
myQuery.ResultTypes = (myQuery.ResultTypes Or ResultType.RelevantResults)
Dim myResults As ResultTableCollection = myQuery.Execute()


Of course, that all assumes the security context for the user is all fine and dandy. If you want to return ALL content, not just what the current user has access to, you need to fire up your favorite impersonation methods here too (again, I will rant on this later - time permitting, which I doubt).
Friday, June 08, 2007 8:31:44 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: .NET Dev | Bugs | SharePoint
A common need in SharePoint 2007 is to create your own Content Types (great new feature) with a bunch of custom columns for metadata tags. The process for this is documented all over the place and easily found, so I won't go into it here. But, what I do want to cover here is how to get those properties setup as "Managed Properties" so you can search only on a given set of your custom columns on the search pages.
 
To do this is basically straight forward and, again, is documented in a lot of places on the web. The basic process is to nav to the SharedServices Admin site and click Search Settings. Then select the link for "Managed Properties". Now click the button labeled "New Managed Property". On that next form, just fill out the appropriate information and click the Add Mapping button. Enter your custom column name and select it from the list, click OK a couple of times and done!
 
Problem:
Well, what you might notice, if you are so lucky as me, is that you CANNOT add the mapping to your custom column. Why Not? It just won't show up in that danged list!!!! Hmm, try forcing a full crawl, still no luck. Delete all my indexes (don't recommend this on production too often) and force a new crawl, STILL no luck.
 
Solution:
As this is all happening on a pre-production system, we didn't have too many docs out there using my new content type. Additionally, most (if not all) of our custom columns are optional, meaning that the docs might not have values for those fields yet. And there's the rub! Until SharePoint crawls at least one document with a value for a custom column, that column cannot be mapped to a Managed Property. So, I uploaded a junk file and set ALL of my custom columns to contain junk data. Forced another crawl, and I HAVE MY MAPPINGS. Now I can setup my custom searches to pull the way I want.
 
Happy Indexing and Searching!
Friday, June 08, 2007 8:26:01 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0] -
Posted By: Mark Wall
Blog Categories: Bugs | Information Architecture | SharePoint | Enterprise Search
Advertisements
Archive
<February 2012>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

Blogroll
Statistics
Total Posts: 27
This Year: 0
This Month: 0
This Week: 0
Comments: 3
Themes
Pick a theme:
All Content © 2012, Mark Wall