Tuesday, May 26, 2009

Add icons to your file extensions in WSS 3.0

By default there is no icon for PDF. In order to add one, modification is required in DOCICON.XML in 12 Hive XML folder. Following steps I got from a blog which is located at

Link: http://servergrrl.blogspot.com/2008/02/adding-pdf-icons-to-wss-30-and-what.html

Quote:
Steps
1). Download the icon file from adobe (or whereever, some people have better ones). Make sure it's small (the default from adobe is 17x17). http://www.adobe.com/misc/linking.html#pdficon

2). Save the icon to the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\IMAGES folder. I renamed it "icpdf.gif" myself, just so it matches the format of all the other doc icon files used in the DOCICON.XML.

3). Open the DOCICON.XML file in notepad (the DOCICON.XML file is located in the c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\XML folder).

4). Once in the DOCICON.XML file, go to the "" section (see figure above) and add the tag: ""(minus the quotes, they're just there to tell you what you are supposed to type-- again, blogger hates it when you add non- html tags)

The tag means that the icon "icpdf.gif" (or whatever you named your pdf icon file) will be mapped to the .pdf extension. I do not have an open control (like using Word to edit a doc file) for pdfs, so I left it blank between the quotes.

5). Save the file, then drop to a command prompt and do an IISRESET. This should let sharepoint know there has been a change and repopulate the pages with new icons appropriately.

IISReset is required after all the above

Wednesday, May 13, 2009

Modifying the width & height of a Sharepoint Page Viewer web part dynamically

Issue:
By default Page viewer web part doesn't allow you to have height expand dynamically. It expects a unit for the height. This small javascript I got from GuiCreate.com does a great job. Basically this script needs to be copied into the page which needs to be displayed in the web part.

JavaScript code:

function resizeMe(that) {
window.resizeTo(document.body.scrollWidth, document.body.scrollHeight);
}
window.attachEvent("onload", function() {
window.setTimeout("resizeMe()", 100);
});


Link: http://www.guicreative.com/blog/sharepoint-2007/modifying-the-width-height-of-a-sharepoint-page-viewer-web-part-dynamically/

WSS Sharepoint Search - no results

In order to turn search ON in WSS 3.0, There two steps

1). Under Operations > Services on Server setup Windows Sharepoint Search Service. Use a domain account when setting this up. If service is already running then skip Step 1 but make sure its properly setup.

2). Under Application Management > Content Databases, click on your content database and then on the page make sure Search Server is selected.

After the above two steps, wait few minutes so Sharepoint crawls your site collection. WSS only lets you search a single site collection. Anything you search under a sub site will give you result at the site collection level.