As promised, here are the sessions that we demonstrated this weekend at the conference. I hope you found them informative and you took away good points and tips.
1. Dataview tips and tricks (creating a relative list dataview and a remote list viewer)
http://www.livepoint.com.au/Downloads/RapidFire%20-%20Dataview%20Tips%20and%20Tricks.pptx
2. Custom Site Maps
http://www.livepoint.com.au/Downloads/RapidFire%20-%20Custom%20Site%20Maps.pptx
Here is a quick set of instructions:
This is the XML file that tells SharePoint what to show in the menus. You can have as many levels as you want in here. For example:
<
</
</siteMapNode>
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\mycustom.sitemap
this will map to _layouts/mycustom.sitemap through the browser.
Go to the web application's web.config file and do the following:
a. Find the "<siteMap" string. In here you will see a number of sitemap providers.
b. add a new line for your custom site map provider
a. Open SharePoint Designer (SPD) and open the master page for your site
b. Look for the line <SharePoint:AspMenu and add the following right above it:
<asp:SiteMapDataSource ShowStartingNode="True" runat="server" ID="MyCustomSiteMap" SiteMapProvider="MyCustomSiteMapProvider" />
a. Still in SPD, look for the <SharePoint:AspMenu node and modify the following properties
DataSourceID="MyCustomSiteMap"
b. If you also want to show more levels then play with the numbers in the nodes for MaximumDynamicDisplayLevels=2 or 3, depending on how many levels you want to show.
c. Save your master page
When you go back to your site and refresh the page, you should see the new menus.
From here, you can :
1. Ensure that the master page is replicated to each site collection so that you get a consistent navigation as your governance and branding policy mandates.
2. Update the site templates with the new master page so that new site or site collections created from these templates have the new design.
When you build public facing sites with WSS or SharePoint, your users may be experiencing a message through IE asking them to run the Name ActiveX control.
This ActiveX control allows users to see presence information in SharePoint (when you go to a document library you can see if the author or editor is online at the time)
To get rid of this message on the browser, method 3 in this article fixes the issue (involves adding a js file to the server and modifying the master page)
http://support.microsoft.com/kb/931509
But recently a colleague at livePoint (Luis) came up with a more elegant solution if you are dealing with externally hosted sites where you don't have access to the file system to install your js file.
His implementation was to add a javascript in the master page.
<script type="text/javascript">function ProcessImn(){}function ProcessImnMarkers(){} </script>
<script type="text/javascript">function ProcessImn(){}function ProcessImnMarkers(){}
</script>
This way when SharePoint loads the page it will use this function implementation and will override the one in the js file at the file system level.
Picture this: You are the farm administrator but when you go to the Shared Services Provider site you get the access denied message and you are asked for credentials!.
Well, there could be a few reasons for this, one being that you have given SSP administration rights to other users (or your SP admin predecessor) or the more likely one is that when MOSS was setup your account was not added as a site collection administrator to the SSP.
To fix this issue, simply go to central admin and assign site collection administration rights to your account.
There is a good site that gives you a number of ways of getting information directly from SQL server in here:
http://www.codeproject.com/KB/dotnet/QueriesToAnalyzeSPUsage.aspx
BUT, If you ever wanted to find out the size of a web via a SQL command, then try this:
I have based this script on the proc_GetDocLibrarySizes and proc_GetListSizes then combined them in a temp table to them group by url and size.
When you run this, supply the Site ID in the @SiteID variable
DECLARE
SET
drop
CREATE
(
FullUrl
ListType
TotalSize
VersionSize
)
INSERT
SELECT
Webs
SUM
FROM
INNER
Lists
Docs
SiteId
DocsInList
tp_ListId
UserData
UserDataInList
GROUP
vq
dq
DocVersions
WebParts
Personalization
select
from
DECLARE @SiteId uniqueidentifierSET @SiteId='E337D8F3-ED87-4CE5-A3CD-37287C4BB342'
drop table #tmptblWebSize
CREATE TABLE #tmptblWebSize(FullUrl VARCHAR (500),ListType VARCHAR (20),TotalSize BIGINT,VersionSize BIGINT)
INSERT INTO #tmptblWebSize(FullUrl, ListType, TotalSize, VersionSize)SELECT Webs.FullUrl, 'Lists',SUM((ISNULL(DocSizes,0) + ISNULL(UserDataSize,0))) As TotalSize, 0FROMWebsINNER JOIN (SELECT Lists.tp_ItemCount, Lists.tp_Title, Lists.tp_Id, Lists.tp_WebID, Lists.tp_Modified, Lists.tp_ServerTemplate, Docs.DirName, Docs.LeafName, Lists.tp_ImageUrl FROM Lists INNER JOIN Docs ON Lists.tp_RootFolder = Docs.Id AND Lists.tp_WebId = Docs.WebId WHERE tp_BaseType <> 1 AND SiteId = @SiteId) As nLists ON Webs.Id = nLists.tp_WebId LEFT OUTER JOIN (SELECT (SUM(CAST((ISNULL(Docs.Size,0)) AS BIGINT))) As DocSizes, Docs.ListId, Docs.SiteId FROM Docs WHERE Docs.Type = 0 AND SiteId = @SiteId GROUP BY Docs.ListId,Docs.SiteId) As DocsInList ON DocsInList.ListId = nLists.tp_ID LEFT OUTER JOIN (SELECT (SUM(CAST((ISNULL(tp_Size,0)) AS BIGINT))) As UserDataSize, tp_ListId FROM UserData GROUP BY UserData.tp_ListId) AS UserDataInList ON UserDataInList.tp_ListId = DocsInList.ListIdGROUP BY Webs.FullUrl
INSERT INTO #tmptblWebSize(FullUrl, ListType, TotalSize, VersionSize)SELECT Webs.FullUrl, 'Doc Libs',SUM(ISNULL(DocSizes,0) + ISNULL(VerSizes,0) + ISNULL(PersonSizes,0) + ISNULL(WpSizes,0)) As TotalSize,VersionSize = SUM(ISNULL(VerSizes,0))FROMWebsINNER JOIN (SELECT Lists.tp_ItemCount, Lists.tp_Title, Lists.tp_Id, Lists.tp_WebID, Lists.tp_Modified, Lists.tp_ServerTemplate, Docs.DirName, Docs.LeafName, Lists.tp_ImageUrl FROM Lists INNER JOIN Docs ON Lists.tp_RootFolder = Docs.Id AND Lists.tp_WebId = Docs.WebId WHERE tp_BaseType = 1 AND SiteId = @SiteId) As nLists ON Webs.Id = nLists.tp_WebId LEFT OUTER JOIN (SELECT vq.VerSize As Versizes, dq.DocSize As DocSizes, dq.ListId As ListId FROM (SELECT (SUM(CAST((ISNULL(Docs.Size, 0)) AS BIGINT))) AS DocSize, Docs.ListId AS ListId FROM Docs WHERE Docs.SiteId = @SiteId AND Docs.Type = 0 GROUP BY Docs.ListId ) AS dq LEFT OUTER JOIN (SELECT (SUM(CAST((ISNULL(DocVersions.Size, 0)) AS BIGINT))) AS VerSize, Docs.ListId AS ListId FROM DocVersions INNER JOIN Docs ON Docs.SiteId = @SiteId AND Docs.Id = DocVersions.Id AND DocVersions.SiteId = @SiteId GROUP BY Docs.ListId ) AS vq ON vq.ListId = dq.ListId ) AS DocsInList ON DocsInList.ListId = nLists.tp_ID LEFT OUTER JOIN (SELECT (SUM(CAST((ISNULL(Personalization.tp_Size,0)) AS BIGINT))) As PersonSizes, (SUM(CAST((ISNULL(WebParts.tp_Size,0)) AS BIGINT))) As WpSizes, WebParts.tp_ListId FROM WebParts LEFT OUTER JOIN Personalization ON Personalization.tp_WebPartId = WebParts.tp_ID GROUP BY WebParts.tp_ListId) As WebPartsInList ON DocsInList.ListId = WebPartsInList.tp_ListIdGROUP BY Webs.FullUrl
select fullurl, sum(totalsize) as WebSize, VersionSize = sum(VersionSize)from #tmptblWebSizeGROUP BY fullurl
----
This is very valuable for migrations and monitoring.
If you want to populate controls in an infopath form based on a selection in a control that looks up a record in an external source, then read on.
I was recently asked by a client to:
1. allow users to select from a drop down a record from an external source (database, sharepoint list, web service)
2. When the item is selected, then other fields in the same row in the grid would need to be populated with information from the master list. See picture below. In this instance, selecting the prod code drop down then populates the description and the cost columns.
so, how do you do this?
The steps in general are (in addition to creating the main data source):
1. Create a secondary source to get the lookup list values
2. Create a rule on the prod code field to populate the description and cost fields.
In my scenario, I used a SharePoint list to make it easier but it can be a web service or a database.
a. Go to the drop down field and right-click Properties.
b. Click on Add... then SElect "Create a new connection to" and select "Receive data"
c. Select "Sharepoint library or list"
d. Specify the URL of the list where the items are stored.
e. Set the Value field to the UNIQUE identifier of the list and the Display Name to another field (usually a Friendly name, description or title of a row)
Once this is done, then you need to set the rules of the field to populate the adjacent ones.
1. Right click on the ProdCode field and select Rules (alternatively from the properties dialog, click Rules...)
2. Click on Add Action...
3. Set Condition...
4. Click on Add Action..., then select "Set a field's value. Select the @ProdDescription from the Main source
5. Click on the Value button, Select "Insert Field or Group", from the data source drop down select the secondary source. then select the field that you want to RETRIEVE from the selected record.
6. this next step is to make sure that we get the right value, otherwise you will be retrieving the first item in the list everytime. This is how we lookup the row. So click on "Filter Data...", then Add...
Select the UNIQUE identifier from the left drop down (in my case ItemNo), then is equal to and then "Select a field or group" from the last drop down
In this dialog you need to select the value from the "Main" datasource that corresponds to the lookup. In my case, it is the ProdCode item in a repeating group.
When you click ok you should see in the Existing filters dialog: ItemNo=current(). and in the final action dialog the followig values:
When you save the form and then publish it you will see how the fields are populated based on the selection from a drop down.
Recently, we migrated a portal in our lab environments. For some reason the owner of the site collection could not be found (various things were done in the production environment, various domain moves, hardware move, etc).
When you try to set the site owner for a site collection
stsadm -o siteowner url http://win2003:100/sites/clients -ownerlogin "win2003\administrator"
it fails with the message "user cannot be found"
or even if you do a stsadm -o enumsites you get something like this
stsadm -o enumsites -url http://win2003:100
<Sites Count="117"> <Site Url="http://win2003:100" Error="User cannot be found." />
...
So the solution I found was to go directly to the database... Yes, I know it is not recommended so do it at your own risk.
My Steps:
1. Navigate to the site settings screen of the site collection
2. Add a user through this method (it works at this level) and add the WIN2003\administrator as a full control user. (this step will create the user in the UserInfo table)
3. Find out the UserID of the newly added user
so, go to the site collection page at this address _layouts/1033/userinfo.aspx
then click on the user you just added and you will see the ID in the URL (in my case ID=469)
4. Open SQL Enterprise manager or your favourite SQL Table editor
Open the Sites table in the appropriate Content database
Find the Record for the site collection your are trying to fix
Change the OwnerID field with the value for the user you just added (469 in my case).
5. Reset IIS (so that the objects are refreshed).
We have been running the infrastructure update for about 1 month now and have updated several clients as well.
We have only had 1 issue recently with a specific client that had some site templates (stp) uploaded to the site collection gallery and could not create sites from them. In fact, SharePoint just hang there with no message at all.
After looking through the logs, event viewer and every other imaginable place to troubleshoot this issue we decided to recreate the template from an existing site... and voila the problem went away.
So if you are considering upgrading to the infrastructure update, perhaps it would be wise to ensure that you create sites out these templates before the upgrade, then after the upgrade save the sites as templates and upload them to the gallery.
We will keep you posted of any other issues that we may find with the infrastructure update. but so far, so good.
This update contains a number of hot fixes rolled up and one of the main ones... support for federated search in SharePoint 2007.
We will be testing this over the next few weeks and blog about this. Download the updates from here:
http://blogs.msdn.com/mikewat/archive/2008/07/15/sharepoint-2007-infrastructure-update-released.aspx
MOSS allows you to display information from the active directory in the user profile store. However, if you want to allow write back to the AD then you need to either write your own custom code or use a tool like this one:
Bamboo solutions has a tool that seems to fit the bill. I will evaluate this very soon and update this blog post.
http://store.bamboosolutions.com/ps-45-5-user-profile-sync.aspx