Mapping search properties
All the columns added to your own custom lists and libraries, appear in the SharePoint search properties as "ows_something". To enable easier searching, I map common properties to the standard SharePoint ones; for instance, mapping ows_department to the urn:schemas-microsoft-com:office:office:department property.
On my development server, I found that when I was trying to map the department property, the list of available properties to map to was limited which was different to the live server. I tracked down the problem to the fact that the list of propeties displayed is limited to those of the same type although, ows_department should have been a string type.
I checked in the database table MX_Properties in the _SERV database and found that the property had a PropertyType of 0 where it should have been 1. I updated the PropertyType and then I was able to map to any of the other properties of a string type.
Deleting Sites in Database
Never play with the SharePoint database unless you have to.
Saying that, I needed to delete a personal site from the database as I couldn't access it from SharePoint from end.
As you may have more than one database storing the sites, you need to remeber to run the SharePoint delete stored procedures in the database that contains the SIte and, in the configuration database.
The stored procedures to do this are proc_dropSite in the config database and DeleteSite in the sites database. Both take the siteID as the only parameter.
Duplicate Personal Sites
I encountered a problem with users creating personal sites as it errored saying a site already exists with that name. The reason was because account names in AD were being re-used for other people so there was a site based on that account name but it related to a different name. The original users details had been overwritten in the Profile database so I couldn't see what was causing the error.
In the end, I had to access the personal site and change the owner to the new users name, this meant changing the owner to myself, deleting the old user from Manage Users and user information and then adding the new user in and making them the owner.
Re-ghost without losing customisation
Whenever you edit a SharePoint page in FrontPage it un-ghosts the page i.e. disconnects it from the template. This is very annoying when you make changes to the site header or navigation in your site templates and discover that you have to open all your un-ghosted pages to make similar changes.
If the only changes you made in Frontpage was to add or modify a web part in a web part zone, such as adding a dataview web part then, you can reconnect the page to the template without losing your customisation.
To re-ghost a page, locate it in the docs table of the _SITE database by dirname and leafname fields and then set the value of Content to NULL.
Query Property PictureURL
I created a custom search results for people to show more information from the users profile to save users having to click the persons name to see the telephone number etc.
The results showed all the information we required but not the Picture even though we was selecting the urn:schemas.microsoft.com:fulltextqueryinfo:PictureURL item and displaying it. So, I started to change the query properites to set the item to be included in the index and display in search results. I also removed the mapping to Personal Picture URL so that I could change this properties Search Options as well which is where I made the mistake.
Some properties in SharePoint search are not updateable so when I removed the mapping and found the picture still didn't show, I couldn't re-map it as this option was greyed out.
To add the mapping back into the property I had to update the database which you should never do. All the properties are listed in the table MX_Properties in the _SERV database. You can then modify the field MappedPropertyID to re-instate the mapping between the 2 Picture URL properties.
Remove upload multiple items
If you want to remove the upload multiple items from a SharePoint library upload page then you need to modify the schema.xml file for the library to enforce the writing out of the function call to remove the row from the table. Search for RemoveMultipleUploadItems in the schema.xml file and remove the switch so that it always writes out the call even if you do have a file type field. You should have just the html tag and the call function call with no switch or case statements.
Now you need to fix a bug in the upload.aspx script which incorrectly check for Mac or Nav the object control. Change this to
if(!browseris.nav && !browseris.mac && EnsureUploadCtl())
You will need to recycle the application pool to re-read your schema.xml changes.
Remove upload multiple items
If you want to remove the upload multiple items from a SharePoint library upload page then you need to modify the schema.xml file for the library to enforce the writing out of the function call to remove the row from the table. Search for RemoveMultipleUploadItems in the schema.xml file and remove the switch so that it always writes out the call even if you do have a file type field. You should have just the following:
RemoveMultipleUploadItems();
]]>
Now you need to fix a bug in the upload.aspx script which incorrectly check for Mac or Nav the object control. Change this to
if(!browseris.nav && !browseris.mac && EnsureUploadCtl())
You will need to recycle the application pool to re-read your schema.xml changes.
Citrix and HTML
Our SharePoint site has a news ticker at the top of the page that draws items added in a list one at a time and leaves on the screen for 5 seconds. The text for news item is drawn across the page one character at a time with a delay between each.
On our citrix sessions, this caused IE to use up 15% of the cpu, bad news. I removed the web part and placed it on a page without any other content and then added this as IFRAME on the main page. This resulted in no CPU being used in the citrix sessions at all. Curious.
Content in onet.xml
If you want to place a content editor web part in the onet.xml file for a site, you need to html encode the text and remove the CDATA tags surrounding the text.
I simply created an ASP.NET application with an input box and a process button that posts back and performs a HTMLEncode on the text.
Import SharePoint Log files
The users wanted to be able to get details of who was using their SharePoint Portal and WSS sites as well as what content they were looking at. There was also a requirement to retrieve the most popular sites and content and, all of this should be avialable through Data View web parts
The only method I could come up with was to use a SQL Analysis cube but, I had to first import the STS log files and parse them out.
I created a DTS that runs the log parser provided by Microsoft against last nights log file to generate a CSV file. THis file is then imported into a temporary table. I then loop through this table and populate tables for the list of sites, department, documents, time and users plus the main data table linking all the lookup tables together in a Star schema. Generating the cube was the easier part with dimensions for site, person, department.
To view the data in a web part, I used the SQL server Linked server to attach to the Analysis service and then use OpenQuery to pull back the results. A simple stored procedure enable me to dynamically build the OpenQuery based on site structure or user name.
List Does not Exist
Users were recieveing the Lists Does not Exist message when viewing a list in SharePoint when the site was created from a Template.
The lists allitems.aspx page had been modifed and the default view changed to a Data List View in FrontPage. When the user created a new site based on a site template containing this modified list, they got a List Does not Exist message. The issue was that the list id had not been changed in the DataQuery section of the Data View web part. To fix the problem, I opended the site in FrontPage and navigated to the allitems.aspx page and copied the list Id that was correct in the ListName property of the Data View and overwrote the ds:query @id = value and the page now works.