November 24, 2011

Creating Custome Dashboards & Count cards in SharePoint 2007

Hi,

in my new SharePoint site creation & customization, we got a one major requirement to create a custom Dashboard & a Count card. so after my googling i got one very useful articale here & here. so by the use of article knowledge i decided to create my own. and the resulting Out put:

in the above 3 places, the DVWP picks the data from the different Libraries & Lists. but here the challenging part that i have faced is to pick the count value of items as uniq (lie part 2, N.of Contributor should be uniq count of users who submitted their ideas from the electronic form to the library)
i struggled to google & found the solution as below:

<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[not (@Username=preceding-sibling::Row/@Username)]" />

Regards,
JK

PowerShell Script To Display All SharePoint Site Collection Administrators In Web Application

Hi,

In my SharePoint Environment, we got a requirement to populate site collection admins list from the couple of  web applications. each web appilication contains 30+ sitecollections. so to pick the list in a manual way is a bit difficult & i am lazy too. so i got this below script in the artcle, and i modified according to my requirement to generate a report. script as below:

[System.Reflection.Assembly]::LoadWithPartialName(”Microsoft.SharePoint”)
$siteUrl = Read-Host "Enter Site URL"
$rootSite = New-Object Microsoft.SharePoint.SPSite($siteUrl)
$spWebApp = $rootSite.WebApplication
 foreach($site in $spWebApp.Sites)
{
    Write-Host "-----------------------------------------------------------"
    Write-Host "$site"
    foreach($siteAdmin in $site.RootWeb.SiteAdministrators)
    {
        Write-Host "$($siteAdmin.Name)"
    }
    $site.Dispose()
    Write-Host "-----------------------------------------------------------"
}
$rootSite.Dispose()


Regards,
Girish

June 15, 2011

Fixing a Pagelayout issue for the migrated site

Hi, Here in my case when i migrated a publishing site after a edit page action in home page and tried to save and exit edit i got stucked with a error message saying:
This page is not using a valid page layout.  To correct the problem, edit page settings and select a valid page layout."
so for this i used a stsadm command to fix this issue
stsadm -o gl-fixpublishingpagespagelayouturl -url http://yoursite/sitename -scope <WebApplication | Site | Web | Page> .... and so on. for my case i used only URL & SCOPE switches. for additional please check the STSADM.EXE -help gl-fixpublishingpagespagelayouturl.

Thanks
jk

May 23, 2011

SharePoint 2010 - Self Training [Through Virtual Labs]

Useful Self Training VLABS - links

Getting Started

SharePoint Server 2010

JK

April 25, 2011

To know Occupied size of individual site collection in SharePoint

Use STSADM.EXE
syntax:-
stsadm -o enumsites -url http://xxxxx/ >test.txt

Example:-
stsadm -o enumsites -url http://mysitecollection/ > test.txt

this will write all site collections occupied size in MB's into a text file.

so how it look like...

<Sites Count="1">
 
<Site
   
Url="http://url"
   
Owner="A\user"
   
SecondaryOwner="A\user2"
   
ContentDatabase="WSS_Content_DB"
   
StorageUsedMB="13756"
   
StorageWarningMB="0"
   
StorageMaxMB="0" /> </Sites>

check it.....

cheer
JK

April 19, 2011

Sharepoint's one of CMS new feature - Avoid Broken Links with SharePoint's Document ID Tool

Hi All,

Today one of user got a problem: She have a document library, which have some attachments(.xls,.doc...). and she is going to refer these attachment URL's in word docs and inside contents as a link to share among the vast users.
Here the problem is:- whenever someone changes/renames the attachment the URL referred at docs/inside contents will break - which is not a Perfect CMS solution [b'cauz we are referring static URL of the Document item from the library] So Microsoft introduced Document ID Tool in Sharepoint 2010 to fulfil this requirement - referring an attachment through Constant ID not through its name. Look at below post [ referred by USER, and she is eager to use/migrate to SP2010 too soon]

In SharePoint 2007 if you rename or move a document then all the existing links to it will be broken. Naturally, this leads to angry users and headaches for IT support and staff in general.
Simply put, it affects productivity, especially if happens often. With SharePoint 2010 this issue is resolved by the introduction of Document ID functionality. Basically, each document gets a unique ID that, regardless of its location, remains the same.
This means that when you move or rename a document this ID will not change. So you end up with a static or permanent link to your documents. You will see later in this tip how this unique ID is used in a special URL to access the document.
Let's see how you can configure and use Document IDs in SharePoint 2010.
1. Browse to your SharePoint site and navigate to the site settings page. Click on the Site Collection Features link located under Site Collection Administration section. Locate the Document ID Service and click Activate.
2. Browse to the Site Settings page and click on the Documents ID Settings link located under Site Collection Administration section as shown below.
3. On the Document ID settings page you can put custom characters in a text box (as shown below) which will be added in the start of Document IDs. If you are using them, make sure they are unique and are not repeated. For the search scope -- which lets you select the search scope that will be used to search for documents based on their IDs -- leave it to default (unless you want to use another scope).
4. You are done, but SharePoint 2010 will start assigning the IDs to the documents once it runs the relevant time jobs. If you look at the figure in step 3, there is text in red mentioning this point.
To get IDs assigned immediately, you have to run the jobs manually and then schedule them with the frequency that suits your needs. To do this, run Document ID assigned job and Document ID enable/disable job, browse to SharePoint Central Administration'Monitoring'Review Job Definitions and click on each of these links (one at a time and click Run Now)
You can also change the schedule of this timer so that it meet your needs, although in the figure above it is set to run after one minute. But this may not be the ideal setting for production environments.
5. Browse to your site collection and upload a document into a document library and verify that the document is assigned with a Document ID. You can view the document properties as shown in the figure below.
Please note that your ID will be different.
6. The document ID field is in the form of URL, if you click on it or see the properties of the link (as shown below) you will notice that document id itself is passed as a query string to a SharePoint page DocIdRedir.aspx.
Now you can pass this link/URL to the users and they can access the document and this link/URL will remain valid even if you rename or move the document.
That's pretty powerful, isn't it? Your IT department and your customers will thank you.

March 31, 2011

Hide "SAVE" button from SharePoint survey

This is another requirement came from user:
His intesion is to hide "SAVE" button from the survey, when it is having link from one question to another.
here the problem is if a survey contails sutch linking pages from question to question, it show "NEXT" "SAVE" "CANCEL" buttos. if user clicks "SAVE" buttot at first question itself the survey end's and the survey comes under incompleted list. which is not expecting the functionality; so by using jquery we can hide the "SAVE" button.

1) Firstofall go to your survey page by clicking "Respond to Survey".
now in the URL after NewForm.aspx add ?PageView=Shared&ToolPaneView=2
like: http://xxxxxxx/xxxxx/NewForm.aspx?PageView=Shared&ToolPaneView=2  , now it will convert the page into edit mode.

2)Now add a content editor web part and copy the below two sections of the scripts in to content editor web part and exit from edit mode, and see the magic :) "SAVE" button will be hidden.
==================================================
//section 1
<script type="text/javascript">
 if(typeof jQuery=='undefined'){
  var jQPath = 'http://ajax.googleapis.com/ajax/libs/jquery/1.3/';
  document.write('<script src="',jQPath,'jquery.min.js" type="text/javascript"><\/script>');
 }
</script>

//section 2
<script type="text/javascript">
$(function() {
 $(":inputs[value='Save']").hide();
  });
</script>
==================================================
so what section 1 will do?
first it will check whether the jquery library included in page or not [it is very important to include jquery library as we are using jquery to hide the button]

what section 2 will do?
it will find Save button and hide it.

thats it...... :)