-
-
This is one of my favorite stupid SharePoint tricks.
If you have a situation where there is a web part (or any web page component) that is slow, and it is slowing the page render time for your page this is a handy trick.
Here is the summary:
- Create another web part page and add the slow loading web part.
- Look at the source code for the render page and get the control id of the div tag for the web part (the skewer click in the IE8 dev toolbar or something similar is an easy way to do this).
- Back on the page where you originally wanted the web part, add a content editor web part
- Put the following script in the source of the web part:
var ctId="ctl00_"; //Replace this with your control ID from step 2
var sourceURL="http://YourServer/somesite/PageThatHasTheSlowWebPart.aspx";
var outputId="MakeshiftAsyncWebPart";
_spBodyOnLoadFunctionNames.push("renderASlowWebPartAsynchronously");
function renderASlowWebPartAsynchronously()
{
loader(sourceURL);
}
function renderOutput(output)
{
document.getElementById(outputId).innerHTML=output;
}
function getElementByClassname(className)
{
var allItems = document.all;
for (var i=0; i < allItems.length; i++)
{
if (allItems[i].className == className)
{
return allItems[i];
}
}
return null;
}
function getElementByClassnameFromString(className,str)
{
var myTempDiv=document.createElement("div");
myTempDiv.innerHTML=str;
var allItems = myTempDiv.all;
for (var i=0; i < allItems.length; i++)
{
if (allItems[i].className == className)
{
return allItems[i];
}
}
return null;
}
function getElementByIDFromString(myID,str)
{
var myTempDiv=document.createElement("div");
myTempDiv.innerHTML=str;
var allItems = myTempDiv.all;
for (var i=0; i < allItems.length; i++)
{
if (allItems[i].id == myID)
{
return allItems[i];
}
}
return null;
}
function loader(url) {
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else if (window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
if (request != undefined)
{
request.onreadystatechange = function() {asyncHandler(url);};
request.open("GET", url, true);
request.send("");
}
}
function asyncHandler(url)
{
if (request.readyState == 4)
{
if (request.status == 200)
{
var output=getElementByIDFromString(ctId,request.responseText).innerHTML;
if (output==null)
{
/*
//Optional:
output="No results";
renderOutput(output);
*/
}
else
renderOutput(output);
}
else
{
//Optional
//document.getElementById('dOutput').innerHTML=" Error: "+ request.status + "\n" +request.statusText;
}
}
}
<div id=”MakeshiftAsyncWebPart”></div>
You can even reference an Animated GIF in SharePoint 2007 for AJAX progress indicators so that users know the web part is loading.
Keep in mind that users won’t get the security prompt for cross site scripting if the two pages are on the same server.
Of course: This code is provided as an example. Use at your own risk. No warranties.
-
-
Here are possible AJAX animation alternatives in http://<myMOSSServer>/<anysiteurl>/_layouts/images/
- Ewr133.gif or GEARS_AN.gif (same)

- Kpiprogressbar.gif

- Ewr120.gif

- Crperspc.gif

These gifs are on all MOSS servers and can be used if you need a quick progress indicator image.
-
-
Ever want the “Incoming Links” page to show up on the wiki page rather than be a separate page? Well, here is a handy web part you can add to a wiki page.
This provided without warranty, just link to this article and tell folks how you used it.
It uses some clever JavaScript to get the content from that page and asynchronously render it in a web part.
- Upload the Incoming Links.dwp file to your Web Part Gallery
- Edit the wiki page in question (not the wiki content, the whole page)
- Add the Incoming Links web part to the web part zone at the bottom of the page.
This will either prevent you from the hassle of also having to support wikimedia in your environment (which is really great if you can) or buy you time until you can deploy SharePoint 2010.
-
-
Here is a handy macro that allows me to set the task priorities in Microsoft Project 2007 based on tasks that I have imported/synchronized to Visual Studio Team System.
The reason I do this is because this allows me to have dependencies between TFS work items, determine which ones need to happen first, level my resources, and calculate completion dates for the work items.
Attribute VB_Name = "Module2"
Sub SetPriorityFromTFS()
Attribute SetPriorityFromTFS.VB_Description = ""
‘Description
LevelingOptions Automatic:=False
For Each T In ActiveProject.Tasks
Select Case T.Text19
Case 1
T.Priority = "900"
Case 2
T.Priority = "700"
Case 3
T.Priority = "500"
Case 4
T.Priority = "300"
Case 5
T.Priority = "100"
End Select
Next T
LevelingOptions Automatic:=True
LevelNow
End Sub
-
-
I recently created a XML Web part that uses XSL and the DHS Threat Level web service to render the current threat level in a way that looks exactly like the DHS Threat Advisory image:

Here it is for free to download with no warranty: DHS Thread Advisory.dwp
There is also an image: http://www.dhs.gov/threat_level/current-sm.gif
For fun, link to this post if you use the web part.
-
-
Very handy for testing and help desk calls:
Tip: insert form version with the expression:
substring-before( substring-after( /processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'solutionVersion="'), '"')
Source: http://www.nivot.org/2008/09/30/WhyVSTO30VisualStudio2008SharePointWindowsWorkflowAndInfoPathMightGiveYouAHernia.aspx
-
-
Scenario: “Please respond to this email indicating your t-shirt size and which session you can attend… or whatever” send to: 40 people.
Read this: http://office.microsoft.com/en-us/access/HA100154271033.aspx
-
-
Add and hide this web part on the page where the reminders web part is located.
Often folks will want to export the Reminders web part from Project Web Access (PWA) 2007 and have it shown on a related SharePoint (MOSS) page. You can export the web part, you can add it to a SharePoint page, you can set the PWA URL to your PWA URL and it will work.
It will throw a javascript error.
The error presents itself as a document.stylesheets[0] etc. etc. javascript error and prevents all javascripts from running (such as menu flyouts).
The attached web part is simply a function redefinition that doesn’t require a feature deployment that fixes the reminders web part on that and only that page.
-
-
These notes are in addition to http://technet.microsoft.com/en-us/library/cc296362.aspx
These are the notes I generated that I used in overlay with the installation instructions.
- Make sure Cert Server is installed and available
- Configure a certificate for ADAM
- Run ADAM setup from internet
· Add/Remove only works if you have the OS disk - Create DNS entries
· For example: collab and collab.external - Create Collab web app
- Reset IIS
- Create email address (e.g. SharePoint@yourdomain.com)
- Extend to an SSL external (e.g. collab.external)
- Create a site collection on the web application
- Run ADAM script that comes with kit
- Change the ADAM Service account
- Run database script
- Run SPScript
Note: ADAM ports are typically 389, 636 or 50000, 50001 - Request IIS Cert
-
-
For some reason my laptop got really sluggish a while back. Normally I wouldn’t blog about this type of thing, but it was so impactful I thought I would share. I’ve already done and always do the typical stuff: defrag, clean registry, uninstall add-ons, maintain free disk space, etc. This one, however, was the culprit.
Check this out if you are experiencing the same: kb822158 Virus scanning recommendations for computers that are running Windows Server 2003, Windows 2000, Windows XP, or Windows Vista
Excerpt: “This article also contains information to help you minimize the effect of antivirus software on system and network performance.”