Wednesday, March 31, 2010

Sharepoint Shortcut Name



BDC = Business Data Catalog and Backup Domain Controller

BI = Business Intelligence

CA = Central Administration and Certificate Authority

CMS = Content Management Server

DMZ = Demilitarized Zone

ECM = Enterprise Content Management

ECS = Excel Calculation Server

KPI = Key Performance Indicators

IIS = Internet Information Services

ISA = Internet Security and Acceleration Server

MMC = Microsoft Management Console

MOSS = Microsoft Office SharePoint Server 2007

O12 = Office 12

OFS = Office Forms Server

OSS = Office SharePoint Server, Office Server System and Open Source System

PDC = Primary Domain Controller

PKI = Public Key Infrastructure

RFC = Request for Comments

SPS = SharePoint Portal Server

SSL = Secure Sockets Layer

STS = SharePoint Team Services

SSP = Shared Services Provider

TLS = Transport Layer Security

URL = Uniform Resource Locater

URN = Uniform Resource Name

URI = Uniform Resource Identifier

VS = Virtual Server 2005, Virtual Server and Visual Studio

VSS = Visual Source Safe, Volume Shadow Copy Service

WA = Web Application

WAS = Web Application Stress tool

WCM = Web Content Management

WSS = Windows SharePoint Services, Web Storage System and Windows Server System

WWF = Windows Workflow Foundation and Worldwide Wrestling Federation

Wednesday, March 24, 2010

SharePoint jQuery: Setting View Column Width

A very common request for changes to SharePoint list views is how to set the column width. This is not possible to do using the ootb "List Settings", and the common suggested fix is to use SharePoint Designer (SPD) and convert the view into an "XSLT Data View": How can I manage columns widths in list views? Most large companies do, however, prevent the use of SPD.

With jQuery there is no need to use SPD or to convert the view. In the following example jQuery will change the width of the two columns "Status description" and "Type of Work" by changing their CSS style attribute.

Start by looking up the HTML markup for the two table headers using View-Source. I'm using jQuery filters that look for the TH elements using a CSS class selector and a content filter. Then add a Content Editor web-part (CEWP) to your page and enter this script in the source editor:

<!--ADJUST TABLE COLUMN WIDTH-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function(){
$("TH.ms-vh2-nograd:contains('Status description')").css("width", "150px");
$("TH.ms-vb:contains('Type of Work')").css("width", "150px");
});
</script>

Tuesday, March 23, 2010

This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application

Scenario:
You scoped your solution to WebApplication and trying to deploy the solution to a particular Web Application

Error:
This solution contains no resources scoped for a Web application and cannot be deployed to a particular Web application.

OR

This solution contains no resources scoped for a Web application and cannot be retracted from a particular Web application.


Reason:
Its because of the parameters passed to STSADM , basically features included in the solution does not contain an assembly which can be scoped to a particular Web Application. What ever assemblies are part of solution are suppose to go GAC and that makes solution a candidate for Global deployment.

Resolution:
Before you read the resolution below: Here's a comment that seems to be more better solution

"Better fix your solution by adding some dummy element that will make the solution deploy-able to a web application. If you have multiple web applications in your farm, usually you don't want to deploy your feature to all of them."

If that is not possible

Remove the URL parameter from STSADM. Do not use the Url parameter with the STSADM command while deploying or retracting such a solution


stsadm -o deploysolution -name SolutionFileName -local stsadm -o retractsolution -name SolutionFileName -local

Monday, March 22, 2010

How to get display form URL of a list item

using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;

SPListItem item = GetItem(); // some code to get a list item
SPList list = item.ParentList;
SPWeb web = list.ParentWeb;

string webUrl = web.Url;
string dispUrl = item.ContentType.DisplayFormUrl;
if(dispUrl == "")
dispUrl = list.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url;
bool isLayouts = dispUrl.StartsWith("_layouts/",StringComparison.CurrentCultureIgnoreCase);
dispUrl = String.Format("{0}/{1}?ID={2}",webUrl,dispUrl,item.ID);
if(isLayouts)
dispUrl = String.Format("{0}&List={1}",dispUrl,SPEncode.UrlEncode(list.ID+""));
As a result, you will get full display form URL of a list item. However, if you want to get just a “clickable” URL, to place in some hyperlink, you don’t need to write so much code. You may create URL by using only an address of a list display form. SharePoint will analyze provided ID of an item then and redirect your request to appropriate page. You may code just:

SPListItem item = GetItem(); // some code to get a list item
SPList list = item.ParentList;
SPWeb web = list.ParentWeb;
string webUrl = web.Url;
string dispUrl = list.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url;;
dispUrl = String.Format("{0}/{1}?ID={2}",webUrl,dispUrl,item.ID);

Wednesday, March 17, 2010

SharePoint DateTime Control Date Format

Normally Sharepoint Datetime control take MM/dd/yyyy date format by default. If your sharepoint site regional settings is different then its mandetory to change date time control property to set original date format for sharepoint control.

<SharePoint: DateTimeControl runat="server".... />



Put



LocaleId="2057"

before the /> bit at the end.

Sharepoint 2010 Key Improvements from MOSS




Thanks to Sushant

Sunday, March 14, 2010

Date Time Control In Sharepoint


<%@ Register TagPrefix="SharePointSD" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" %>
<div>
<table>
<tr>
<td style="width: 100px">
Start Date</td>
<td style="width: 100px">
<SharePointSD:DateTimeControl runat="server" ID="dteDemo1" DateOnly="True">
<asp:TextBox runat="server" MaxLength="45" CssClass="ms-input" ID="dtpDateTimeIdentifierTextBox1">
</asp:TextBox>
</SharePointSD:DateTimeControl>
</td>
<td style="width: 100px">
End Date</td>
<td style="width: 100px">
<SharePointSD:DateTimeControl runat="server" ID="dteDemo2" DateOnly="True">
<asp:TextBox runat="server" MaxLength="45" CssClass="ms-input" ID="dtpDateTimeIdentifierTextBox2">
</asp:TextBox>
</SharePointSD:DateTimeControl>
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td colspan="3">
<asp:CompareValidator id="cv" runat="server" ForeColor="red" Type="date" Operator="GreaterThan" ErrorMessage="End Date shoule be greater than start date"

ControlToCompare="dteDemo1$dteDemo1Date" ControlToValidate="dteDemo2$dteDemo2Date" ></asp:CompareValidator></td>
</tr>


</table>

</div>