Tuesday, November 23, 2010

Rich Text Column in Document Library

WSS – Rich Text column in Document Library

Being not able to add a rich text column to a document library, is frustrating as I wanted to use the column to hold rich text. It is possible to use a rich text column in a doc library but it must be done using a content type, Here are some instructions below on to get a document library setup with a rich text column:
  1. Configure ‘Advanced Settings’ for the document library and enable the management of content types.
  2. Create a new Site Column as multiline rich text.
  3. Create a new Content Type and add the column created in step 2.
  4. Add the Content Type to the document library using the ‘Add from existing site content types’ link.
  5. Save the document library as a template and delete the document library.
  6. Create the document library again using the template from step 5.
  7. Success! You should now be able to use a rich text column within a document library.
Thanks:  http://sharepointcoding.wordpress.com/2009/05/28/wss-rich-text-column-in-document-library/

Monday, November 22, 2010

List - Update Columns behind the screen based on other columns

<script language="javascript" type="text/javascript">
_spBodyOnLoadFunctionNames.push("populateFieldvalues");

    var populate = getField('select','Current Status');
    populate.onchange = populateFieldvalues;

    function populateFieldvalues() {
        var control = getField('select','Current Status'); //Based on the Value of this 'Current Status', Status &Description will be changed. Ex: If yellow is selected for 1 column, other column named Status, its URL and Desc would be changed accordingly.
        var Statusurl = getField('input', 'Status');
        var Statusdesc = getField('input', 'Description');

        if (control.options[0].selected) {
            Statusurl.value = "http://YourServer/sites/SC1/SubSite1/ImageLibrary/white.gif";
            Statusdesc.value = "White";
            }
           
        else if (control.options[1].selected) {
            Statusurl.value = "http://YourServer/sites/SC1/SubSite1/ImageLibrary/green.gif";
            Statusdesc.value = "Green";
            }

        else if (control.options[2].selected) {
            Statusurl.value = "http://YourServer/sites/SC1/SubSite1/ImageLibrary/yellow.gif";
            Statusdesc.value = "Yellow";
            }
           
        else if (control.options[3].selected) {
            Statusurl.value = "http://YourServer/sites/SC1/SubSite1/ImageLibrary/red.gif";
            Statusdesc.value = "Red";
            }

        }

    function getField(fieldType,fieldTitle) {
           var docTags = document.getElementsByTagName(fieldType);
        for (var i=1; i < docTags.length; i++) {
            if (docTags[i].title == fieldTitle) {
                return docTags[i];
            }
           }
    }
   
</script>

Friday, November 19, 2010

Creating and Customizing Document Information Panel with Infopath 2007



Document Information Panel

Announcements ListView WebPart - Modifying View

Using Sharepoint Designer, change the existing listView to XSL DataView and then change the following to modify the view:

<xsl:template name="dvt_1.rowview">
        <p class="ms-vb">
             <a href="http://YourServer/sites/Dev1/Lists/NameOfList/DispForm.aspx?ID={@ID}"><xsl:value-of select="@Title" /></a>
            <br />By
            <xsl:value-of select="@Author" disable-output-escaping="yes" /><br />
            <xsl:value-of select="@Body" disable-output-escaping="yes" /></p></xsl:template>






Wednesday, November 17, 2010

Bulk Update List Items using JQuery WebService

Querying and Updating the List

(1)Add a CEWP on any default.aspx page [Not on any of the List view pages]
(2)Copy paste the code and change URLs for List and Site along with Column names that you want to Update with
(3) 2 functions btnPublishAll() - Gets each List items ID's and Title  and fxnPublishList() - Updates each List item's PublishColumn to Published.
(4)Add your list(YourListName) webpart on the same page, so that Button to bulk publish all items for the List and List would be on the same page.


<script type="text/javascript">

$(function($){
        $("#btnPublishAll").click(function(){
           var soapEnv =
            "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                     <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        <listName>YourListName</listName> \
                        <viewFields> \
                            <ViewFields> \
                               <FieldRef Name='ID' /> \
                               <FieldRef Name='Publish' /> \
                           </ViewFields> \
                        </viewFields> \
                    </GetListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>";

        $.ajax({
            url: "http://YourServer/sites/Dev1/myDev1/_vti_bin/lists.asmx",
            type: "POST",
            dataType: "xml",
            data: soapEnv,
            complete: processResult,
            contentType: "text/xml; charset=\"utf-8\""
        }); // end $.ajax()

                function processResult(xData, status) {
                     $(xData.responseXML).find("z\\:row").each(function() {
                     //Here you get the ID's of each Item in the List and we can call Update function using these ID's
                      var liHtml = "<li>" + $(this).attr("ows_Title") + "</li>"; //To Display each List items Title in a row
                      //$("#TestUL").append(liHtml);
                       fxnPublishList( $(this).attr("ows_ID"), "Published" ) ;
                        window.location="YourPage"; //To Refresh the page after the Update.
                                   
                  });
                } // end processResult
                                               
                                               
   }); // end click
  
 
  
}); // end ready

function fxnPublishList(ItemID,ItemNewValue)
{
    var soapEnv =
        "<?xml version='1.0' encoding='utf-8'?> \
            <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'> \
                <soapenv:Body> \
                     <UpdateListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \
                        <listName>YourListName</listName> \
                        <viewName>AllItems</viewName> \
                        <updates><Batch OnError='Continue' PreCalc='TRUE'> \
                               <Method ID='1' Cmd='Update'> \
                                  <Field Name='Publish'>" + ItemNewValue + "</Field> \
                                  <Field Name='ID'>" + ItemID + "</Field> \
                               </Method> \
                        </Batch></updates> \
                    </UpdateListItems> \
                </soapenv:Body> \
            </soapenv:Envelope>";
   
    $.ajax({
        url: "http://YourServer/sites/Dev1/myDev1/_vti_bin/lists.asmx",
        beforeSend: function(xhr){ xhr.setRequestHeader("SOAPAction","http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");},
        type: "POST",
        dataType: "xml",
        data: soapEnv,
        contentType: "text/xml; charset=\"utf-8\""
    }); // end $.ajax()
}


</script>
<p/><p/>
<input type="button" id="btnPublishAll" value="Publish All" />


Reference:  Link to Jan Tielens Blog for querying list items.

Tuesday, November 9, 2010

Build URL for webservices Ex: Lists.asmx

 var hrefParts = window.location.href.split('/');
            var wsURL = "";
            for (i = 0; i < (hrefParts.length - 2); i++) {
                if (i > 0)
                    wsURL += "/";
                wsURL += hrefParts[i];
            }
            wsURL += "/_vti_bin/lists.asmx";

Remove *Title Column in a Sharepoint List

SharePoint List items all have a Title column (although it’s display name might be changed to something else). This Title column is a string, which is unfortunate as sometimes you really don’t need a string column on a list; this was the need I faced.
You can make a Title column not required:
turn-off-title-requirement
Also, if you go to the ‘Advanced Settings’ page of your list and ‘Allow management of Content Types’ you can then go into your content types and Hide the Title column. This is okay – but the Title column is still there – it’s just being displayed with “(no title)”…
List View Showing Title
That’s not such a problem for views on a list – you can simply choose to not show the Title column. But unfortunately, some other pages (such as EditForm.aspx and DispForm.aspx) use the Title column in their title and navigation:
original-edit-form
“(no title)” sucks a bit, especially as we probably do have something better to use as a title. I decided to use jQuery to replace the “(no title)”s in the Edit and Display forms:
code
Or, as text:
<script language="javascript" type="text/javascript">
$(document).ready(function() {
var user = $("span[class='ms-entity-resolved'] > span[id='content']");
var userText = user.text();
document.title = "Users - " + userText;
var pageTitle = $("h2[class='ms-pagetitle']");
var pageTitleHtml = pageTitle.html();
pageTitle.html(pageTitleHtml.replace("(no title)",userText));
var pageLink = $("td[class='ms-titlearea']");
var pageLinkHtml = pageLink.html();
pageLink.html(pageLinkHtml.replace("(no title)",userText));
});
</script>

Here I’m getting the new title from my user field – but you might want to use another field. Whatever, the same principle of using jQuery to get the value would work.
Then I update the Browser’s title bar with the new title.
Next, I select the page title and replace “(no title)” with my new title, before writing the html back, and finally I repeat this with the “(no title)” link in the breadcrumb. The end result is:
modified-edit-form
Nice. I repeated this for my Dispform.aspx too, though not the new Item form – it doesn’t display the title at all (as a new item doesn’t have one yet!) I also added an edit button to my list so that users can still edit these items:
modified-list-view
(And yes, there are other ways of dealing with this – building  proper custom edit and display forms, for example – but this is quite low effort)

Reference:  http://www.novolocus.com/2009/06/02/using-jquery-to-remove-the-title-of-a-list/

Friday, October 22, 2010

Show/Hide free form text field on dropdown choice : Specify your own value


<script type="text/javascript" src="http://YourServer/development/jQuery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

 //will  hide as the default selected column value is other than "Other" .
   var TitleSpan = $("span[Title='ColumnInternalName: Specify your own value:']").closest("tr").hide();
   var TitleInput = $("input[Title='ColumnInternalName : Specify your own value:']").closest("tr").hide();

//on dropdown choice change, we can show or hide the "specify your own value"
   $("select[title$=Column Name: Choice Drop Down']").change(function()
   {
     var selectedItem = $("#ctl00_m_g_XXXXXX_ctl00_DropDownChoice :selected").text();
     if(selectedItem == "Other")
      {
          var TitleSpan = $("span[Title='Column Name: Specify your own value:']").closest("tr").show();
          var TitleInput = $("input[Title='Column Name : Specify your own value:']").closest("tr").show();
      }
      else
      {
          var TitleSpan = $("span[Title=Column Name: Specify your own value:']").closest("tr").hide();
          var TitleInput = $("input[Title=Column Name : Specify your own value:']").closest("tr").hide();
      }
    });
 
 
});

</script>

Thursday, August 19, 2010

SharePoint 2010 Certification and SharePoint 2007 Certification


I’m a big proponent of the Microsoft Certification program and think that anyone in the IT industry working with Microsoft technologies should have a certification for their field.Do I think a certification means that you know what you are doing?  Nope… I’ve met people that have certifications, and didn’t know diddly-squat when it came to ‘real-world’ work.  To the contrary, I’ve also met people that do not have certifications, but know a specific technology inside and out.
Still, I think it’s beneficial to anyone’s career and something that I’m an advocate of.  Why is it beneficial though? The Microsoft Learning website puts it best:
Build your expertise and advance your career. By earning a Microsoft Certification, you gain advanced, market-relevant skills that employers recognize and respect as well as opportunities to connect with a global community of other certified professionals. Additionally, certification provides you with access to exclusive Microsoft resources and benefits, such as the MCP member Web site, career-building tools, and training. Explore the benefits of certification—and start your journey to attaining your ideal career.

To date, I’ve been pretty disappointed in the lack of certifications available for SharePoint 2007.  Let’s look at what we currently have.

Existing SharePoint 2007 Certifications

MCTS – Microsoft Certified Technology Specialist
IT Pro
Exam 70-630: TS: Office SharePoint Server 2007, Configuring
Exam 70-631: TS: Configuring Windows SharePoint Services 3.0
Dev Exam 70-541: TS: Microsoft Windows SharePoint Services 3.0 - Application Development
Exam 70-542 : TS: Microsoft Office SharePoint Server 2007, Application Development
So the inherent problem in my opinion now becomes apparent… MCTS is the lowest level of Microsoft Certification, and the next available certification is the Master program.
MCM – Microsoft Certified Master
IT Pro / Dev
Microsoft Certified Master: Microsoft Office SharePoint Server 2007
The Master program is an advanced certification, and costs a good bit of money as well. It’s worth it for sure, I will not argue against this.  It’s a true practical test of your ability, and comes with 3 weeks of classroom courses led by some of the industry’s best.
But for a certification ‘path’, it has not existed for SharePoint.  There is the lower certification and the advanced certification – nothing in the middle.

Future SharePoint 2010 Certifications
(Disclaimer: this information is not confirmed or posted anywhere that I have seen.  Its based upon printed marketing material, and the 2010 certification release of other server platforms.)

With the release of SharePoint 2010 this year, there will also be a release of new certifications.  The best part however, is that there will be the release of additional certifications that will fill the gap of that middle-ground.
MCTS – Microsoft Certified Technology Specialist
SharePoint Server 2010
Exam 70-667: TS: Microsoft SharePoint 2010, Configuring
Developer, SharePoint Server 2010 Exam 70-573: TS: Microsoft SharePoint 2010, Application Development
MCITP – Microsoft Certified IT Professional
SharePoint Server 2010
Exam 70-668: PRO: SharePoint 2010, Administrator
MCPD– Microsoft Certified Professional Developer
Developer, SharePoint Server 2010
Exam 70-576: PRO: Designing and Developing Microsoft SharePoint 2010 Applications
MCM – Microsoft Certified Master
IT Pro / Dev
Microsoft Certified Master: SharePoint Server 2010
Although I’m not graphically showing a road map here, as you may be able to interpret these are in order of a career path, so MCTS would come before MCITP / MCPD and those would come before MCM.  There are also plans for a MCA (Microsoft Certified Architect) that have not been released.  Essentially that’s the cream of the crop.
Now that I think about it, the Microsoft Certification path follows almost a Higher Education academic degree system, and probably not by mistake.
MCTS = Associate’s Degree
MCITP/MCPD = Bachelor’s Degree
MCM = Master’s Degree
MCA = Doctoral Degree
I’m pretty pumped about the new certs coming out.  If you don’t have any certifications associated with your name, it will be a great year to get started.  :)

Thanks to Dan Lewis for his post.

Monday, August 9, 2010

STSADM full commands for MOSS 2007 SP1

The following command are the STSADM tool commands for MOSS 2007 SP1. The STSADM is a great utility that you can REALLY control anything in your MOSS server. The underlined commands can ONLY be used with SP1:
  1. stsadm -o activatefeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-url <url>] [-force]
  2. stsadm -o activateformtemplate -url <URL to the site collection> [-formid <form template ID>] [-filename <path to form template file>]
  3. stsadm -o addalternatedomain -url <protocol://existing.WebApplication.URLdomain> -incomingurl <protocol://incoming.url.domain> -urlzone <default, extranet, internet, intranet, custom> -resourcename <non-web application resource name>
  4. stsadm -o addcontentdb -url <url> -databasename <database name> [-databaseserver <database server name>] [-databaseuser <database username>] [-databasepassword <database password>] [-sitewarning <site warning count>] [-sitemax <site max count>]
  5. stsadm -o adddataconnectionfile -filename <path to file to add> [-webaccessible <bool>] [-overwrite <bool>] [-category <bool>]
  6. stsadm -o add-ecsfiletrustedlocation -Ssp <SSP name> -Location <URL|UNC> -LocationType SharePoint|Unc|Http -IncludeChildren True|False [-SessionTimeout <time in seconds>] [-ShortSessionTimeout <time in seconds>] [-MaxRequestDuration <time in seconds>] [-MaxWorkbookSize <file size in Mbytes>] [-MaxChartSize <size in Mbytes>] [-VolatileFunctionCacheLifetime <time in seconds>] [-DefaultWorkbookCalcMode File|Manual|Auto|AutoDataTables] [-AllowExternalData None|Dcl|DclAndEmbedded] [-WarnOnDataRefresh True|False] [-StopOpenOnRefreshFailure True|False] [-PeriodicCacheLifetime <time in seconds>] [-ManualCacheLifetime <time in seconds>] [-MaxConcurrentRequestsPerSession <number of requests>] [-AllowUdfs True|False] [-Description <descriptive text>]
  7. stsadm -o add-ecssafedataprovider -Ssp <SSP name> -ID <data provider id> -Type Oledb|Odbc|OdbcDsn [-Description <descriptive text>]
  8. stsadm -o add-ecstrusteddataconnectionlibrary -Ssp <SSP name> -Location <URL> [-Description <descriptive text>]
  9. stsadm -o add-ecsuserdefinedfunction -Ssp <SSP name> -Assembly <strong name|file path> -AssemblyLocation GAC|File [-Enable True|False] [-Description <descriptive text>]
  10. stsadm -o addexemptuseragent -name <user-agent to receive InfoPath files instead of a Web page>
  11. stsadm -o addpath -url <url> -type <explicitinclusion/wildcardinclusion>
  12. stsadm -o addpermissionpolicy -url <url> -userlogin <login name> -permissionlevel <permission policy level> [-zone <URL zone>] [-username <display name>]
  13. stsadm -o addsolution -filename <Solution filename> [-lcid <language>]
  14. stsadm -o addtemplate -filename <template filename> -title <template title> [-description <template description>]
  15. stsadm -o adduser -url <url> -userlogin <DOMAIN\user> -useremail <email address> -role <role name> / -group <group name> -username <display name> [-siteadmin]
  16. stsadm -o addwppack  -filename <Web Part Package filename> [-lcid <language>] [-url <url>] [-globalinstall] [-force] [-nodeploy]
  17. stsadm -o addwppack  -name <name of Web Part Package> [-lcid <language>] [-url <url>] [-globalinstall] [-force]
  18. stsadm -o addzoneurl -url <protocol://existing.WebApplication.URLdomain> -urlzone <default, extranet, internet, intranet, custom> -zonemappedurl <protocol://outgoing.url.domain> -resourcename <non-web application resource name>
  19. stsadm -o allowuserformwebserviceproxy -url <Url of the web application> -enable <true to enable, false to disable>
  20. stsadm -o allowwebserviceproxy -url <Url of the web application> -enable <true to enable, false to disable>
  21. stsadm -o associatewebapp -title <SSP name> [-default | -parent] -url <Web application 1 url,Web application 2 url> [-all]
  22. stsadm -o authentication -url <url> -type <windows/forms/websso> [-usebasic (valid only in windows authentication mode)] [-usewindowsintegrated (valid only in windows authentication mode)] [-exclusivelyusentlm (valid only in windows authentication mode)] [-membershipprovider <membership provider name>] [-rolemanager <role manager name>] [-enableclientintegration] [-allowanonymous]
  23. stsadm -o backup -url <url> -filename <filename> [-overwrite]
  24. stsadm -o backup -directory <UNC path> -backupmethod <full | differential> [-item <created path from tree>] [-percentage <integer between 1 and 100>] [-backupthreads <integer between 1 and 10>] [-showtree] [-quiet]
  25. stsadm -o backuphistory -directory <UNC path> [-backup] [-restore]
  26. stsadm -o binddrservice -servicename <data retrieval service name> -setting <data retrieval services setting>
  27. stsadm -o blockedfilelist -extension <extension> -add [-url <url>]
  28. stsadm -o blockedfilelist -extension <extension> -delete [-url <url>]
  29. stsadm -o canceldeployment -id <id>
  30. stsadm -o changepermissionpolicy -url <url> -userlogin <DOMAIN\name> [-zone <URL zone>] [-username <display name>] [{ -add | -delete } -permissionlevel <permission policy level>]
  31. stsadm -o copyappbincontent
  32. stsadm -o createadminvs [-admapidname <app pool name>] [-admapidtype <configurableid/NetworkService>] [-admapidlogin <DOMAIN\name>] [-admapidpwd <app pool password>]
  33. stsadm -o createcmsmigrationprofile -profilename <profile name> [-description <description>] [-connectionstring <connection string>] -databaseserver <server>  -databasename <name>  -databaseuser <username>  [-databasepassword <password>] [-auth windowsauth|sqlauth] -destination <url> [-rootchannel <channelname>] [-destinationlocale <LCID>] [-migrateresources onlyused|all] [-migrateacls yes|no] [-emailto <address1;address2>] [-emailon success|failure|none|both] [-keeptemporaryfiles Never|Always|Failure] [-enableeventreceivers yes|no]
  34. stsadm -o creategroup -url <url> -name <group name> -description <description> -ownerlogin <DOMAIN\name or group name> [-type member|visitor|owner]
  35. stsadm -o createsite -url <url> -owneremail <email address> [-ownerlogin <DOMAIN\name>] [-ownername <display name>] [-secondaryemail <email address>] [-secondarylogin <DOMAIN\name>] [-secondaryname <display name>] [-lcid <language>] [-sitetemplate <site template>] [-title <site title>] [-description <site description>] [-hostheaderwebapplicationurl <web application url>] [-quota <quota template>]
  36. stsadm -o createsiteinnewdb -url <url> -owneremail <email address> [-ownerlogin <DOMAIN\name>] [-ownername <display name>] [-secondaryemail <email address>] [-secondarylogin <DOMAIN\name>] [-secondaryname <display name>] [-lcid <language>] [-sitetemplate <site template>] [-title <site title>] [-description <site description>] [-hostheaderwebapplicationurl <web application url>] [-quota <quota template>] [-databaseuser <database username>] [-databasepassword <database password>] [-databaseserver <database server name>] [-databasename <database name>]
  37. stsadm -o createssp -title <SSP name> -url <Web application url> -mysiteurl <MySite Web application url> -ssplogin <username> -indexserver <index server> -indexlocation <index file path> [-ssppassword <password>] [-sspdatabaseserver <SSP database server>] [-sspdatabasename <SSP database name>] [-sspsqlauthlogin <SQL username>] [-sspsqlauthpassword <SQL password>] [-searchdatabaseserver <search database server>] [-searchdatabasename <search database name>] [-searchsqlauthlogin <SQL username>] [-searchsqlauthpassword <SQL password>] [-ssl <yes|no>]
  38. stsadm -o createweb -url <url> [-lcid <language>] [-sitetemplate <site template>] [-title <site title>] [-description <site description>] [-convert] [-unique]
  39. stsadm -o databaserepair -url <url> -databasename <database name> [-deletecorruption]
  40. stsadm -o deactivatefeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-url <url>] [-force]
  41. stsadm -o deactivateformtemplate -url <URL to the site collection> [-formid <form template ID>] [-filename <path to form template file>]
  42. stsadm -o deleteadminvs
  43. stsadm -o deletealternatedomain -url <ignored> -incomingurl <protocol://incoming.url.domain>
  44. stsadm -o deletecmsmigrationprofile -profilename <profile name>
  45. stsadm -o deleteconfigdb
  46. stsadm -o deletecontentdb -url <url> -databasename <database name> [-databaseserver <database server name>]
  47. stsadm -o deletegroup -url <url> -name <group name>
  48. stsadm -o deletepath -url <url>
  49. stsadm -o deletepermissionpolicy -url <url> -userlogin <login name> [-zone <URL zone>]
  50. stsadm -o deletesite -url <url> -deleteadaccounts <true/false>
  51. stsadm -o deletesolution -name <Solution name> [-override] [-lcid <language>]
  52. stsadm -o deletessp -title <SSP name> [-deletedatabases]
  53. stsadm -o deletessptimerjob -title <SSP Name> -jobid <SSP Timer Job Id>
  54. stsadm -o deletetemplate -title <template title> [-lcid <language>]
  55. stsadm -o deleteuser -url <url> -userlogin <DOMAIN\name> [-group <group>]
  56. stsadm -o deleteweb -url <url>
  57. stsadm -o deletewppack -name <name of Web Part Package> [-lcid <language>] [-url <url>]
  58. stsadm -o deletezoneurl -url <protocol://existing.WebApplication.URLdomain> -urlzone <default, extranet, internet, intranet, custom> -resourcename <non-web application resource name>
  59. stsadm -o deploysolution -name <Solution name> [-url <virtual server url>] [-allcontenturls] [-time <time to deploy at>] [-immediate] [-local] [-allowgacdeployment] [-allowcaspolicies] [-lcid <language>] [-force]
  60. stsadm -o deploywppack -name <Web Part Package name> [-url <virtual server url>] [-time <time to deploy at>] [-immediate] [-local] [-lcid <language>] [-globalinstall] [-force]
  61. stsadm -o disablessc -url <url>
  62. stsadm -o displaysolution -name <Solution name>
  63. stsadm -o editcmsmigrationprofile -profilename <profile name> [-description <description>] [-connectionstring <connection string>] [-databaseserver <server>] [-databasename <name>] [-databaseuser <username>] [-databasepassword <password>] [-auth sqlauth|windowsauth] [-emailto <address1;address2>] [-emailon success|failure|none|both] [-excludeschema ] [-keeptemporaryfiles Never|Always|Failure] [-enableeventreceivers yes|no]
  64. stsadm -o editcontentdeploymentpath -pathname <path name> [-keeptemporaryfiles Never|Always|Failure] [-enableeventreceivers yes|no] [-enablecompression yes|no]
  65. stsadm -o editssp -title <SSP name> [-newtitle <new SSP name>] [-sspadminsite <administration site url>] [-ssplogin <username>] [-ssppassword <password>] [-indexserver <index server>] [-indexlocation <index file path>] [-setaccounts <process accounts (domain\username)>] [-ssl <yes|no>]
  66. stsadm -o email -outsmtpserver <SMTP server> -fromaddress <email address> -replytoaddress <email address> -codepage <codepage> [-url <url>]
  67. stsadm -o enablecmsurlredirect -profilename <profile name> -off
  68. stsadm -o enablessc -url <url> [-requiresecondarycontact]
  69. stsadm -o enumalternatedomains -url <protocol://existing.WebApplication.URLdomain> -resourcename <non-web application resource name>
  70. stsadm -o enumcontentdbs -url <url>
  71. stsadm -o enumdataconnectionfiledependants -filename <filename for which to enumerate dependants>
  72. stsadm -o enumdataconnectionfiles [-mode <a | u | all | unreferenced>]
  73. stsadm -o enumdeployments
  74. stsadm -o enumexemptuseragents
  75. stsadm -o enumformtemplates
  76. stsadm -o enumgroups -url <url>
  77. stsadm -o enumroles -url <url>
  78. stsadm -o enumservices
  79. stsadm -o enumsites -url <virtual server url> -showlocks -redirectedsites
  80. stsadm -o enumsolutions
  81. stsadm -o enumssp -title <SSP name> [-default | -parent | -all]
  82. stsadm -o enumssptimerjobs -title <SSP Name>
  83. stsadm -o enumsubwebs -url <url>
  84. stsadm -o enumtemplates [-lcid <language>]
  85. stsadm -o enumusers -url <url>
  86. stsadm -o enumwppacks [-name <name of Web Part Package>] [-url <virtual server url>] [-farm]
  87. stsadm -o enumzoneurls -url <protocol://existing.WebApplication.URLdomain> -resourcename <non-web application resource name>
  88. stsadm -o execadmsvcjobs
  89. stsadm -o export -url <URL to be exported> -filename <export file name> [-overwrite] [-includeusersecurity] [-haltonwarning] [-haltonfatalerror] [-nologfile] [-versions <1-4> 1= Last major version for files and list items (default), 2= The current version, either the last major or the last minor, 3= Last major and last minor version for files and list items, 4= All versions for files and list items] [-cabsize <integer from 1-1024 megabytes> (default: 25)] [-nofilecompression] [-quiet]
  90. stsadm -o extendvs -url <url> -ownerlogin <domain\name> -owneremail <email address> [-exclusivelyusentlm] [-ownername <display name>] [-databaseuser <database user>] [-databaseserver <database server>] [-databasename <database name>] [-databasepassword <database user password>] [-lcid <language>] [-sitetemplate <site template>] [-donotcreatesite] [-description <iis web site name>] [-sethostheader] [-apidname <app pool name>] [-apidtype <configurableid/NetworkService>] [-apidlogin <DOMAIN\name>] [-apidpwd <app pool password>] [-allowanonymous]
  91. stsadm -o extendvsinwebfarm -url <url> -vsname <web application name> [-exclusivelyusentlm] [-apidname <app pool name>] [-apidtype <configurableid/NetworkService>] [-apidlogin <DOMAIN\name>] [-apidpwd <app pool password>] [-allowanonymous]
  92. stsadm -o forcedeleteweb -url <url>
  93. stsadm -o formtemplatequiescestatus [-formid <form template ID>] [-filename <path to form template file>]
  94. stsadm -o getadminport
  95. stsadm -o getdataconnectionfileproperty -filename <filename of the data connection file> -pn <property name>
  96. stsadm -o getformsserviceproperty -pn <option name>
  97. stsadm -o getformtemplateproperty [-formid <form template ID>] [-filename <path to form template file>] -pn <property name>
  98. stsadm -o getproperty -propertyname <property name> [-url <url>] (SharePoint cluster properties: avallowdownload, avcleaningenabled, avdownloadscanenabled, avnumberofthreads, avtimeout, avuploadscanenabled, command-line-upgrade-running, database-command-timeout, database-connection-timeout, data-retrieval-services-enabled, data-retrieval-services-oledb-providers, data-retrieval-services-response-size, data-retrieval-services-timeout, data-retrieval-services-update, data-source-controls-enabled, dead-site-auto-delete, dead-site-notify-after, dead-site-num-notifications, defaultcontentdb-password, defaultcontentdb-server, defaultcontentdb-user, delete-web-send-email, irmaddinsenabled, irmrmscertserver, irmrmsenabled, irmrmsusead, job-ceip-datacollection, job-config-refresh, job-database-statistics, job-dead-site-delete, job-usage-analysis, job-watson-trigger, large-file-chunk-size, token-timeout, workflow-cpu-throttle, workflow-eventdelivery-batchsize, workflow-eventdelivery-throttle, workflow-eventdelivery-timeout, workflow-timerjob-cpu-throttle, workitem-eventdelivery-batchsize, workitem-eventdelivery-throttle; SharePoint virtual server properties: alerts-enabled, alerts-limited, alerts-maximum, change-log-expiration-enabled, change-log-retention-period, data-retrieval-services-enabled, data-retrieval-services-inherit, data-retrieval-services-oledb-providers, data-retrieval-services-response-size, data-retrieval-services-timeout, data-retrieval-services-update, data-source-controls-enabled, days-to-show-new-icon, dead-site-auto-delete, dead-site-notify-after, dead-site-num-notifications, defaultquotatemplate, defaulttimezone, delete-web-send-email, job-change-log-expiration, job-dead-site-delete, job-diskquota-warning, job-immediate-alerts, job-recycle-bin-cleanup, job-usage-analysis, job-workflow, job-workflow-autoclean, job-workflow-failover, max-file-post-size, peoplepicker-activedirectorysearchtimeout, peoplepicker-distributionlistsearchdomains, peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode, peoplepicker-onlysearchwithinsitecollection, peoplepicker-searchadcustomquery, peoplepicker-searchadforests, presenceenabled, recycle-bin-cleanup-enabled, recycle-bin-enabled, recycle-bin-retention-period, second-stage-recycle-bin-quota, send-ad-email)
  99. stsadm -o getsitedirectoryscanschedule
  100. stsadm -o getsitelock -url <url>
  101. stsadm -o getsiteuseraccountdirectorypath -url <url>
  102. stsadm -o geturlzone -url <protocol://incoming.url.domain>
  103. stsadm -o grantiis7permission
  104. stsadm -o import -url <URL to import to> -filename <import file name> [-includeusersecurity] [-haltonwarning] [-haltonfatalerror] [-nologfile] [-updateversions <1-3> 1= Add new versions to the current file (default), 2= Overwrite the file and all its versions (delete then insert),3= Ignore the file if it exists on the destination] [-nofilecompression] [-quiet]
  105. stsadm -o installfeature {-filename <relative path to Feature.xml from system feature directory> | -name <feature folder>} [-force]
  106. stsadm -o listlogginglevels [-showhidden]
  107. stsadm -o listregisteredsecuritytrimmers -ssp <ssp name>
  108. stsadm -o localupgradestatus
  109. stsadm -o managepermissionpolicylevel -url <url> -name <permission policy level name> [{ -add | -delete }] [-description <description>] [-siteadmin <true | false>] [-siteauditor <true | false>] [-grantpermissions <comma-separated list of permissions>] [-denypermissions <comma-separated list of permissions>]
  110. stsadm -o mergecontentdbs -url <url> -sourcedatabasename <source database name> -destinationdatabasename <destination datbabase name> [-operation <1-3> 1 - Analyze (default) 2 - Full Database Merge 3 - Read from file] [-filename <file generated from stsadm -o enumsites>]
  111. stsadm -o migrateuser -oldlogin <DOMAIN\name> -newlogin <DOMAIN\name> [-ignoresidhistory]
  112. stsadm -o osearch [-action <list|start|stop>] required parameters for 'start' (if not already set): role, farmcontactemail, service credentials [-f (suppress prompts)] [-role <Index|Query|IndexQuery>] [-farmcontactemail <email>] [-farmperformancelevel <Reduced|PartlyReduced|Maximum>] [-farmserviceaccount <DOMAIN\name> (service credentials)] [-farmservicepassword <password>] [-defaultindexlocation <directory>] [-propagationlocation <directory>] [-cleansearchdatabase <true|false>] [-ssp <ssp name>] required parameter for 'cleansearchdatabase'
  113. stsadm -o osearchdiacriticsensitive -ssp <ssp name> [-setstatus <True|False>] [-noreset] [-force]
  114. stsadm -o preparetomove {-ContentDB <DatabaseServer:DatabaseName> | -Site <URL>} [-OldContentDB <uniqueidentifier>] [-undo]
  115. stsadm -o profilechangelog -title <SSP Name> -daysofhistory <number of days> -generateanniversaries
  116. stsadm -o profiledeletehandler -type <Full Assembly Path>
  117. stsadm -o provisionservice -action <start/stop> -servicetype <servicetype (namespace or assembly qualified name if not SharePoint service)> [-servicename <servicename>]
  118. stsadm -o quiescefarm -maxduration <duration in minutes>
  119. stsadm -o quiescefarmstatus
  120. stsadm -o quiesceformtemplate [-formid <form template ID>] [-filename <path to form template file>] -maxduration <time in minutes>
  121. stsadm -o reconvertallformtemplates
  122. stsadm -o refreshdms -url <url>
  123. stsadm -o refreshsitedms -url <url>
  124. stsadm -o registersecuritytrimmer -ssp <ssp name> -id <0 - 2147483647> -typename <assembly qualified TypeName of ISecurityTrimmer implementation> -rulepath <crawl rule URL> [-configprops <name value pairs delimited by '~'>]
  125. stsadm -o registerwsswriter
  126. stsadm -o removedataconnectionfile -filename <filename to remove>
  127. stsadm -o removedrservice -servicename <data retrieval service name> -setting <data retrieval services setting>
  128. stsadm -o remove-ecsfiletrustedlocation -Ssp <SSP name> -Location <URL|UNC> -LocationType SharePoint|Unc|Http
  129. stsadm -o remove-ecssafedataprovider -Ssp <SSP name> -ID <data provider id> -Type Oledb|Odbc|OdbcDsn
  130. stsadm -o remove-ecstrusteddataconnectionlibrary -Ssp <SSP name> -Location <URL>
  131. stsadm -o remove-ecsuserdefinedfunction -Ssp <SSP name> -Assembly <strong name|file path> -AssemblyLocation GAC|File
  132. stsadm -o removeexemptuseragent -name <user-agent to receive InfoPath files instead of a Web page>
  133. stsadm -o removeformtemplate [-formid <form template ID>] [-filename <path to form template file>]
  134. stsadm -o removesolutiondeploymentlock [-server <server> [-allservers]
  135. stsadm -o renameserver -oldservername <oldServerName> -newservername <newServerName>
  136. stsadm -o renamesite -oldurl <oldUrl> -newurl <newUrl> 
  137. stsadm -o renameweb -url <url> -newname <new subsite name>
  138. stsadm -o restore -url <url> -filename <filename> [-hostheaderwebapplicationurl <web application url>] [-overwrite]
  139. stsadm -o restore -directory <UNC path> -restoremethod <overwrite | new> [-backupid <Id from backuphistory, see stsadm -help backuphistory>] [-item <created path from tree>] [-percentage <integer between 1 and 100>] [-showtree] [-suppressprompt] [-username <username>] [-password <password>] [-newdatabaseserver <new database server name>] [-quiet]
  140. stsadm -o restoressp -title <SSP name> -url <Web application url> -ssplogin <username> -mysiteurl <MySite Web application url> -indexserver <index server> -indexlocation <index file path> [-keepindex] -sspdatabaseserver <SSP database server> -sspdatabasename <SSP database name> [-ssppassword <password>] [-sspsqlauthlogin <SQL username>] [-sspsqlauthpassword <SQL password>] [-searchdatabaseserver <search database server>] [-searchdatabasename <search database name>] [-searchsqlauthlogin <SQL username>] [-searchsqlauthpassword <SQL password>] [-ssl <yes|no>]
  141. stsadm -o retractsolution -name <Solution name> [-url <virtual server url>] [-allcontenturls] [-time <time to remove at>] [-immediate] [-local] [-lcid <language>]
  142. stsadm -o retractwppack -name <Web Part Package name> [-url <virtual server url>] [-time <time to retract at>] [-immediate] [-local] [-lcid <language>]
  143. stsadm -o runcmsmigrationprofile -profilename <profile name> [-skipanalyzer ] [-onlyanalyzer ] [-startover ] [-migratesincetime <DateTime string>] [-migrationfolder <path>] [-exportonly ] [-importonly ] [-htmldiff <path>]
  144. stsadm -o runcontentdeploymentjob -jobname <name> [-wait yes|no] [-deploysincetime <datetime>] (<datetime> as "MM/DD/YY HH:MM:SS")
  145. stsadm -o scanforfeatures [-solutionid <Id of Solution>] [-displayonly]
  146. stsadm -o setadminport -port <port> [-ssl] [-admapcreatenew] [-admapidname <app pool name>]
  147. stsadm -o setapppassword -password <password>
  148. stsadm -o setbulkworkflowtaskprocessingschedule -schedule <recurrence string>
  149. stsadm -o setconfigdb [-connect] -databaseserver <database server> [-databaseuser <database user>] [-databasepassword <database user password>] [-databasename <database name>] [-exclusivelyusentlm] [-farmuser] [-farmpassword] [-adcreation] [-addomain <Active Directory domain>] [-adou <Active Directory OU>]
  150. stsadm -o setcontentdeploymentjobschedule -jobname <name> -schedule <schedule> (Schedule Parameter Examples: "every 5 minutes between 0 and 59", "hourly between 0 and 59", "daily at 15:00:00", "weekly between Fri 22:00:00 and Sun 06:00:00", "monthly at 15 15:00:00", "yearly at Jan 1 15:00:00")
  151. stsadm -o setdataconnectionfileproperty -filename <filename of the data connection file> -pn <property name> -pv <property value>
  152. stsadm -o setdefaultssp -title <SSP name>
  153. stsadm -o set-ecsexternaldata -Ssp <SSP name> [-ConnectionLifetime <time in seconds>] [-UnattendedServiceAccountName <account name>] [-UnattendedServiceAccountPassword <account password>]
  154. stsadm -o set-ecsloadbalancing -Ssp <SSP name> [-Scheme WorkbookUrl|RoundRobin|Local] [-RetryInterval <time in seconds>]
  155. stsadm -o set-ecsmemoryutilization -Ssp <SSP name> [-MaxPrivateBytes <memory in MBytes>] [-MemoryCacheThreshold <percentage>] [-MaxUnusedObjectAge <time in minutes>]
  156. stsadm -o set-ecssecurity -Ssp <SSP name> [-FileAccessMethod UseImpersonation|UseFileAccessAccount] [-AccessModel Delegation|TrustedSubsystem] [-RequireEncryptedUserConnection False|True] [-AllowCrossDomainAccess True|False]
  157. stsadm -o set-ecssessionmanagement -Ssp <SSP name> [-MaxSessionsPerUser <number of sessions>]
  158. stsadm -o set-ecsworkbookcache -Ssp <SSP name> [-Location <local or UNC path>] [-MaxCacheSize <storage in Mbytes>] [-EnableCachingOfUnusedFiles True|False]
  159. stsadm -o setformsserviceproperty -pn <option name> -pv <option value>
  160. stsadm -o setformtemplateproperty [-formid <form template ID>] [-filename <path to form template file>] -pn <property name> -pv <property value>
  161. stsadm -o setholdschedule -schedule <recurrence string>
  162. stsadm -o setlogginglevel [-category < [CategoryName | Manager:CategoryName [;...]] >] {-default | -tracelevel  < None;  Unexpected; Monitorable; High; Medium; Verbose> [-windowslogginglevel < None;  ErrorServiceUnavailable;  ErrorSecurityBreach;  ErrorCritical;  Error;  Warning;  FailureAudit; SuccessAudit;  Information;  Success>] }
  163. stsadm -o setpolicyschedule -schedule <recurrence string>
  164. stsadm -o setproperty -propertyname <property name> -propertyvalue <property value> [-url <url>] (SharePoint cluster properties:, avallowdownload, avcleaningenabled, avdownloadscanenabled, avnumberofthreads, avtimeout, avuploadscanenabled, command-line-upgrade-running, database-command-timeout, database-connection-timeout, data-retrieval-services-enabled, data-retrieval-services-oledb-providers, data-retrieval-services-response-size, data-retrieval-services-timeout, data-retrieval-services-update, data-source-controls-enabled, dead-site-auto-delete, dead-site-notify-after, dead-site-num-notifications, defaultcontentdb-password, defaultcontentdb-server, defaultcontentdb-user, delete-web-send-email, irmaddinsenabled, irmrmscertserver, irmrmsenabled, irmrmsusead, job-ceip-datacollection, job-config-refresh, job-database-statistics, job-dead-site-delete, job-usage-analysis, job-watson-trigger, large-file-chunk-size, token-timeout, workflow-cpu-throttle, workflow-eventdelivery-batchsize, workflow-eventdelivery-throttle, workflow-eventdelivery-timeout, workflow-timerjob-cpu-throttle, workitem-eventdelivery-batchsize, workitem-eventdelivery-throttle; SharePoint virtual server properties:, alerts-enabled, alerts-limited, alerts-maximum, change-log-expiration-enabled, change-log-retention-period, data-retrieval-services-enabled, data-retrieval-services-inherit, data-retrieval-services-oledb-providers, data-retrieval-services-response-size, data-retrieval-services-timeout, data-retrieval-services-update, data-source-controls-enabled, days-to-show-new-icon, dead-site-auto-delete, dead-site-notify-after, dead-site-num-notifications, defaultquotatemplate, defaulttimezone, delete-web-send-email, job-change-log-expiration, job-dead-site-delete, job-diskquota-warning, job-immediate-alerts, job-recycle-bin-cleanup, job-usage-analysis, job-workflow, job-workflow-autoclean, job-workflow-failover, max-file-post-size, peoplepicker-activedirectorysearchtimeout, peoplepicker-distributionlistsearchdomains, peoplepicker-nowindowsaccountsfornonwindowsauthenticationmode, peoplepicker-onlysearchwithinsitecollection, peoplepicker-searchadcustomquery, peoplepicker-searchadforests, presenceenabled, recycle-bin-cleanup-enabled, recycle-bin-enabled, recycle-bin-retention-period, second-stage-recycle-bin-quota, send-ad-email)
  165. stsadm -o setrecordsrepositoryschedule -schedule <recurrence string>
  166. stsadm -o setsearchandprocessschedule -schedule <recurrence string>
  167. stsadm -o setsharedwebserviceauthn -ntlm | -negotiate
  168. stsadm -o setsitedirectoryscanschedule -schedule <recurrence string> (Schedule parameter examples: "every 5 minutes between 0 and 59", "hourly between 0 and 59", "daily at 15:00:00", "weekly between Fri 22:00:00 and Sun 06:00:00", "monthly at 15 15:00:00", "yearly at Jan 1 15:00:00")
  169. stsadm -o setsitelock -url <url> -lock <none | noadditions | readonly | noaccess>
  170. stsadm -o setsiteuseraccountdirectorypath -url <url> [-path <path>]
  171. stsadm -o setsspport -httpport <HTTP port number> -httpsport <HTTPS port number>
  172. stsadm -o setworkflowconfig -url <url> {-emailtonopermissionparticipants <enable|disable> | -externalparticipants <enable|disable> | -userdefinedworkflows <enable|disable>}
  173. stsadm -o siteowner -url <url> [-ownerlogin <DOMAIN\name>] [-secondarylogin <DOMAIN\name>]
  174. stsadm -o spsearch [-action <list | start | stop | attachcontentdatabase | detachcontentdatabase | fullcrawlstart | fullcrawlstop>] [-f (suppress prompts)] [-farmperformancelevel <Reduced | PartlyReduced | Maximum>] [-farmserviceaccount <DOMAIN\name> (service credentials)] [-farmservicepassword <password>] [-farmcontentaccessaccount <DOMAIN\name>] [-farmcontentaccesspassword <password>] [-indexlocation <new index location>] [-databaseserver <server\instance> (default: josebda-moss)] [-databasename <database name> (default: SharePoint_WSS_Search)] [-sqlauthlogin <SQL authenticated database user>] [-sqlauthpassword <password>] -action list -action stop [-f (suppress prompts)] -action start -farmserviceaccount <DOMAIN\name> (service credentials) [-farmservicepassword <password>] -action attachcontentdatabase [-databaseserver <server\instance> (default: josebda-moss)] -databasename <content database name> [-searchserver <search server name> (default: josebda-moss)] -action detachcontentdatabase [-databaseserver <server\instance> (default: josebda-moss)] -databasename <content database name> [-f (suppress prompts)] -action fullcrawlstart -action fullcrawlstop
  175. stsadm -o spsearchdiacriticsensitive [-setstatus <True|False>] [-noreset] [-force]
  176. stsadm -o sync {-ExcludeWebApps <web applications> | -SyncTiming <schedule(M/H/D:value)> | -SweepTiming <schedule(M/H/D:value)> | -ListOldDatabases <days> | -DeleteOldDatabases <days>}
  177. stsadm -o syncsolution -name <Solution name>] [-lcid <language>] [-alllcids]
  178. stsadm -o syncsolution -allsolutions
  179. stsadm -o unextendvs -url <url> [-deletecontent] [-deleteiissites]
  180. stsadm -o uninstallfeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-force]
  181. stsadm -o unquiescefarm
  182. stsadm -o unquiesceformtemplate [-formid <form template ID>] [-filename <path to form template file>]
  183. stsadm -o unregistersecuritytrimmer -ssp <ssp name> -id <0 - 2147483647>
  184. stsadm -o unregisterwsswriter
  185. stsadm -o updateaccountpassword -userlogin <DOMAIN\name> -password <password> [-noadmin]
  186. stsadm -o updatealerttemplates -url <url> [-filename <filename>] [-lcid <language>
  187. stsadm -o updatefarmcredentials [-identitytype <configurableid/NetworkService>] [-userlogin <DOMAIN\name>] [-password <password>] [-local [-keyonly]]
  188. stsadm -o upgrade {-inplace | -sidebyside} [-url <url>] [-forceupgrade] [-quiet] [-farmuser <farm user>] [-farmpassword <farm user password>] [-reghost] [-sitelistpath <sites xml file>]
  189. stsadm -o upgradeformtemplate -filename <path to form template file> [-upgradetype <upgrade type>]
  190. stsadm -o upgradesolution -name <Solution name> -filename <upgrade filename> [-time <time to upgrade at>] [-immediate] [-local] [-allowgacdeployment] [-allowcaspolicies] [-lcid <language>]
  191. stsadm -o upgradetargetwebapplication -url <URL to upgrade> -relocationurl <new URL for non-upgraded content> -apidname <new app pool name> [-apidtype <configurableid/NetworkService>] [-apidlogin <DOMAIN\name>] [-apidpwd <app pool password>] [-exclusivelyusentlm]
  192. stsadm -o uploadformtemplate -filename <path to form template file>
  193. stsadm -o userrole -url <url> -userlogin <DOMAIN\name> -role <role name> [-add] [-delete]
  194. stsadm -o verifyformtemplate -filename <path to form template file>
Originally found on th following URL, thanks to Jose Barreto:
http://blogs.technet.com/josebda/archive/2008/03/15/complete-reference-of-all-stsadm-operations-with-parameters-in-moss-2007-sp1.aspx

Monday, August 2, 2010

Tiny SharePoint Calendar




Have you tried dropping a SharePoint month calendar on the home page of your SharePoint site? The result… not so cute: the calendar eats up half of the screen.


 In this post I am going to show how with the help of CSS you can shrink your SharePoint calendar and make it fit in the right column of a SharePoint page. The picture shows you the expected result.

So let’s start by dropping on our right column a monthly view of the calendar and a hidden Content Editor Web Part. In the source editor of the CEWP, paste the code below:


<style type="text/css">


/* Tiny Calendar */


/* Remove week blocks */
.ms-cal-weekempty {display:none;}
 .ms-cal-week {display:none;}
.ms-cal-weekB {display:none;}
.ms-cal-weekB {display:none;}

/* Shrink cells */
.ms-cal-workitem2B {display:none;}
.ms-cal-noworkitem2B {display:none;}
.ms-cal-nodataBtm2 {display:none;}
.ms-cal-todayitem2B {display:none;}
.ms-cal-workitem {font-size:0px;}
.ms-cal-muworkitem {font-size:0px;}
.ms-cal-noworkitem {font-size:0px;}
.ms-cal-nodataMid {font-size:0px;}
.ms-cal-todayitem {font-size:0px;}

/* thin out header */
.ms-cal-nav {display:none;}
.ms-cal-nav-buttonsltr {display:none;}
.ms-cal-navheader {padding:0px;spacing:0px;}
.ms-calheader IMG {width:15px;}

/* Abbreviate weekdays */
.ms-cal-weekday {letter-spacing:6px; width:22px; overflow: hidden;}

</style>

  
 
What this CSS does:

* height:

- Reduce the height of the calendar cells
- Reduce the height of the header

* width:

- Only keep the first letter of the weekday names
- Simplify the header options to just keep previous and next month
- Reduce the “bone” that forces the width of the header
- Remove the week boxes to the left of the calendar

Note that if you click on a day, SharePoint will open a full size day view of your calendar – I have chosen to keep this as the expected behavior. If you don’t like it you can simply deactivate the JavaScript that triggers the day view.

We now have our cute calendar that tells us that today is October 6 and that October 28th is a Tuesday.

The next step is to display the list items, so that I know for example that Halloween is on October 31st. This will be the object of part II. Of course, we’ll have to accept some constraints because of the reduced size of the calendar.

How about the bottom border. To get it, in the Web Part settings select:
Appearance -->Chrome type -->Border only.

Thanks to Christophe:
http://blog.pathtosharepoint.com/2008/10/06/tiny-sharepoint-calendar-1/

Wednesday, July 28, 2010

Filter multiple List Columns & also by specific columns

Add a Content Editor webpart to the page with the following script in the Source Editor:


<script src="http://www.google.com/jsapi"></script>

<script>

google.load("jquery", "1.2.6");google.setOnLoadCallback(function() {

$(document).ready(function(){

jQuery.extend(jQuery.expr[':'], { containsIgnoreCase: "(a.textContent

a.innerText

jQuery(a).text()

'').toLowerCase().indexOf((m[3]

'').toLowerCase())>=0"

});





$("table.ms-listviewtable tr.ms-viewheadertr").each(function()

{
if($("td.ms-vh-group", this).size() > 0){return;}
var tdset = "";var colIndex = 0;
$(this).children("th,td").each(function()

{

//modify the test columns here....
if( ($(this).hasClass("ms-vh-icon")) ||($(this).text()== "col2") || ($(this).text() == "col3") )

{// attachment
tdset += "<td></td>";
}else

{// filterable
tdset += "<td><input type='text' class='vossers-filterfield' filtercolindex='" + colIndex + "' /></td>";
}

colIndex++;
});

var tr = "<tr class='vossers-filterrow'>" + tdset + "</tr>";
$(tr).insertAfter(this);
});



$("input.vossers-filterfield")

.css("border", "1px solid #7f9db9")
.css("width", "100%").css("margin", "2px")
.css("padding", "2px").keyup(function()
{
var inputClosure = this;
if(window.VossersFilterTimeoutHandle)
{
clearTimeout(window.VossersFilterTimeoutHandle);
}

window.VossersFilterTimeoutHandle = setTimeout(function()

{

var filterValues = new Array();

$("input.vossers-filterfield", $(inputClosure).parents("tr:first")).each(function()

{

if($(this).val() != "")

{
filterValues[$(this).attr("filtercolindex")] = $(this).val();
}

});

$(inputClosure).parents("tr.vossers-filterrow").nextAll("tr").each(function()

{

var mismatch = false;


$(this).children("td").each(function(colIndex)
{
if(mismatch) return;

if(filterValues[colIndex])
{
var val = filterValues[colIndex];

// replace double quote character with 2 instances of itself

val = val.replace(/"/g, String.fromCharCode(34) + String.fromCharCode(34));

if($(this).is(":not(:containsIgnoreCase('" + val + "'))"))

{
mismatch = true;

}

}

});


if(mismatch)

{

$(this).hide();

}

else

{

$(this).show();

}

});



}, 250);

});

});


});


</script>

Thanks to http://instantlistfilter.codeplex.com/

Monday, July 12, 2010

Modify form labels, Hide or remove columns in SharePoint form

In the CEWP or on the new item page or on the Display.aspx add the following script

<script type="text/javascript" src="http://YourServer/sites/yourSubsite/JQuery/jquery-1.4.2.min.js"></script>
<script type="text/javascript">

fields = init_fields();

var dateTypeLabel = "<div style='color:red'>Please enter the Date Type. (...custom text added by adressing the formlabel with jQuery!)</div>"
var applicationLabel = "<div style='color:red;font-size:9px;'><i>Please enter the Application Name</i></div>";

//Can change more field labels similarly & all the variables defined are the field Internal names


$(fields['DateType']).find(".ms-formlabel h3").after(dateTypeLabel);
$(fields['ApplicationName']).find(".ms-formlabel h3").after(applicationLabel);
// after appends the content whereas .text() changes the existing field label to new label

//Can also append text to labels on hover

//$(fields['DateType']).find(".ms-formlabel h3").hover(
//   function(){     $(fields['DateType']).find(".ms-formlabel h3").append(dateTypeLabel);  },
//   function(){     $(fields['DateType']).find(".ms-formlabel h3").text("DateType");       }
//)

// Hide the Current user label display ( to show only selected labels )
//$(fields['Current_x0020_User']).find(".ms-formlabel h3").parent().parent().hide();
////$(fields['Current_x0020_User']).find(".ms-formlabel h3").parent().parent().hide();

//Set Status(like color,font...) of  Few or Many columns at a time
var arrCFC = ["Col1", "Col2",  "Col3", "Col8", "Col9", "Col12", "Col13", "Col14"];

           //  All these columns, labels here are turned blue
          jQuery.each(arrCFC, function() {
               $(fields[this]).find(".ms-formlabel h3").parent().parent().css("color","Blue");
               $(fields[this]).find(".ms-formlabel h3").css("color","Blue");
  
             });

function init_fields(){
  var res = {};
  $("td.ms-formbody").each(function(){
      if($(this).html().indexOf('FieldInternalName="')<0) return;
      var start = $(this).html().indexOf('FieldInternalName="')+19;
      var stopp = $(this).html().indexOf('FieldType="')-7;
      var nm = $(this).html().substring(start,stopp);
      res[nm] = this.parentNode;
  });
  return res;
}
</script>

Reference:  http://sharepointjavascript.wordpress.com/2009/10/03/modify-formlabel-in-sharepoint-form/
(By Alexander)

Wednesday, July 7, 2010

Jquery - Adding Tabs with each tab refers to a new page

//Download all the necessary plugins from Jquery UI: http://jqueryui.com/download
<script type="text/javascript" src="Javascript/JQuery/jquery-1.4.2.js"></script>
    <script type="text/javascript" src="Javascript/JQuery/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="Javascript/JQuery/jquery.ui.tabs.js"></script>
    <link type="text/css" href="Javascript/JQuery/jquery-ui-1.8.2.custom.css" rel="stylesheet" >
   
    <style type="text/css" >
    ul.tabs {
    margin: 0;
    padding: 0;
    float: left;
    list-style: none;
    height: 32px; /*--Set height of tabs--*/
    border-bottom: none;
    border-left: 1px solid #999;
    width: 100%;
}
ul.tabs li {
    float: left;
    margin: 0;
    padding: 0;
    height: 31px; /*--Subtract 1px from the height of the unordered list--*/
    line-height: 31px; /*--Vertically aligns the text within the tab--*/
    border: 1px solid #999;
    border-left: none;
    margin-bottom: -1px; /*--Pull the list item down 1px--*/
    overflow: hidden;
    position: relative;
    background: #e0e0e0;
}
ul.tabs li a {
    text-decoration: none;
    color: #000;
    display: block;
    font-size: 1.2em;
    padding: 0 20px;
    border: 1px solid #fff; /*--Gives the bevel look with a 1px white border inside the list item--*/
    outline: none;
}
ul.tabs li a:hover {
    background: #ccc;
}
html ul.tabs li.active, html ul.tabs li.active a:hover  { /*--Makes sure that the active tab does not listen to the hover properties--*/
    background: #fff;
    border-bottom: 1px solid #fff; /*--Makes the active tab look like it's connected with its content--*/
}
   
   
    .tab_container {
   
    border: none;
    overflow: hidden;
    clear: both;
    float: left; width: 100%;
    background: #fff;
}
.tab_content {
    padding: 20px;
    font-size: 1.2em;
}
    </style>
   
   

<ul class="tabs">
    <li><a href="#tab1" onClick="parent.location='/sites/.../..../AllItems.aspx'">Tab 1</a></li>
    <li><a href="#tab2" onClick="parent.location='/.../.../Page2.aspx'">Tab 2</a></li>
    <li><a href="#tab3" onClick="parent.location='/sites/.../.../Page3.aspx'">Tab 3</a></li>
    <li><a href="#tab4" onClick="parent.location='/sites/.../.../Page4.aspx'">Tab 4</a></li>
</ul>

<div class="tab_container">
    <div id="tab1" class="tab_content">
        <!--Content-->
                This is a Colloboration site for Page 1 Team Members. This is the Content in Page 1 &amp; Tab 1
    </div>
    <div id="tab2" class="tab_content">
       <!--Content-->
       This is the Home Page for Page 2. This is the Content in Page 1 &amp;     Tab2
    </div>
</div>








<script type="text/javascript">
$(document).ready(function() {

    //When page loads...
    $(".tab_content").hide(); //Hide all content
    $("ul.tabs li:first").addClass("active").show(); //Activate first tab & li:eq(1) to show second url
    $(".tab_content:first").show(); //Show first tab content

    //On Click Event
    $("ul.tabs li").click(function() {

        $("ul.tabs li").removeClass("active"); //Remove any "active" class
        $(this).addClass("active"); //Add "active" class to selected tab
        $(".tab_content").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;
    });
});
</script>

Tuesday, June 29, 2010

Jquery: List Items QuickView

 hoverImg = '/_layouts/images/OPENDB.GIF';
      hoverImgDescription = 'Hover mouse over this image to preview the metadata';
                              // The description text added to the top of the page.
                              // If left blank, no description is added to the top of the page.
      arrOfFieldsToShow = ['Title','Description']; // Leave blank to show all fields. To have only the content and not the label, use this format ['Title|0']
      prependHoverImageTo = ''; // The standard placement is "Title-field" for lists and "Name-field" for document library.
                                  // If used with multi line text with append, insert FieldInternalName of "append-field" here.



function getLoadedFields(){
  var res = {};
  $("#jLoadMe td.ms-formbody").each(function(){
      if($(this).html().indexOf('FieldInternalName="')<0) return;
      var start = $(this).html().indexOf('FieldInternalName="')+19;
      var stopp = $(this).html().indexOf('FieldType="')-7;
      var nm = $(this).html().substring(start,stopp);
      res[nm] = {'label':nm,'html':$(this).html()};
  });
  return res;
}

function jLoadMe(t,pX,pY,listBaseType) {//load content
if(listBaseType==0){
    var whatToLoad = " #part1";
}else if(listBaseType==1){
    var whatToLoad = " #onetIDListForm";
}
    $("#jLoadMe").load(t + whatToLoad, function() {
        if(arrOfFieldsToShow.length==0){
            $("#jLoadMe").css({'width':'590'});
            $("#jLoadMe h3").css({'font-size':'8pt'});
            $("#jLoadMe .ms-formtoolbar:first").hide();
            $("#jLoadMe table.ms-toolbar").hide();
            $("#jLoadMe .ms-ButtonHeightWidth").hide();
            var contentWidth = '590';
            var contentHeight = $("#jLoadMe").height();
        }else{
            $("#jLoadMe h3").css({'font-size':'8pt'});
            var contentWidth = '400';
            var selectedRow = '';
            $.each(arrOfFieldsToShow,function(idx,item){
                var split = item.split('|');
                var fieldTitle = split[0];
                var showTitle = split[1];
                jLoadMeFields = getLoadedFields();
               
               
                if(showTitle!=0){
                    selectedRow += "<b>" + jLoadMeFields[fieldTitle].label + "</b>" + " - ";
                }
                selectedRow += jLoadMeFields[fieldTitle].html + "</br>";
            });
            selectedRow = "<div style='width:" + contentWidth + "'>" + selectedRow + "</div>";




            //    if(showTitle!=0){
                //    selectedRow += "<div style='font-weight:bold;border-bottom:1px silver solid;'>" + jLoadMeFields[fieldTitle].label + "</div>";
            //    }
            //    selectedRow += "<div style='padding:0 0 5 3;margin-left:5;border-left:1px silver solid'>" + jLoadMeFields[fieldTitle].html + "</div>";
        //    });
        //    selectedRow = "<div style='width:" + contentWidth + "'>" + selectedRow + "</div>";
            $("#jLoadMe").html(selectedRow);
            var contentHeight = $("#jLoadMe").height();
        }
        // Get height and width of current window
        var winHeight = $(window).height();
        var winWidth = $(window).width();
        var winScroll = $(window).scrollTop();
        // Calculate the best position for the popup Y-axis
        if((winHeight - pY) < contentHeight){
            if((pY - winScroll) < contentHeight){
                pY = winScroll + 10
            }else{
                pY = (pY - contentHeight) - 30
            }
        }
        // Calculate the best position for the popup X-axis
        if((winWidth - pX) < contentWidth){
            pX = (pX - contentWidth) - 30;
        }
        // Show popup
        $("#jLoadMe")
            .css({'position':'absolute',
                'left':pX,
                'top':pY,
                'background-color':'f8f8ff',
                'border':'2px silver ridge',
                'padding':3})
            .show().mouseenter(function(){
                $(this).hide();
            });
    });
}

function initjLoadMe() { // Loop trough all elements and add hover function
isAppendField = false;
    $("div[id^='WebPartWPQ']").each(function(){
        var thisListCTX = $(this).find("table[ctxname]:first").attr('ctxname');
        if(thisListCTX!=undefined){
            thisListCTX = eval(thisListCTX);
            var listBaseType = thisListCTX.listBaseType;
            if(listBaseType==0){ // List
                if(prependHoverImageTo!=''){// Apend style field
                    whatToFind = "a[href$='SPBookmark_" + prependHoverImageTo + "']";
                    isAppendField = true;
                }else{
                    var whatToFind = "a[href*='DispForm.aspx'][target='_self']";
                }
            }else if(listBaseType==1){ // Document library
                var whatToFind = "td.ms-vb-title";
            }
        }else if($(this).find("a[href*='DispForm.aspx']").length>0){ // Catch calendar views
            var listBaseType = 0;
            var whatToFind = "a[href*='DispForm.aspx'][target='_self']";
        }

        $(this).find(whatToFind).each(function(){
            if($(this).parent().find(".mouseOverImg").length==0){
                if(listBaseType==0){
                    if(isAppendField){
                        var url = $(this).attr("href");
                        url = url.substring(0,url.indexOf('#'));
                    }else{
                        var url = $(this).attr("href");
                        if(url.indexOf('#')>-1) return;
                    }
                    //$(this).before("<a href='" + url + "'><img class='mouseOverImg' src='" + hoverImg + "' height='8' width='8' border='0'></a>&nbsp;");
                }else if(listBaseType==1){
                    // Get id of item from table id
                    var table = $(this).find('table:first');
                    var tableId = table.attr('id');
                    var url = eval(table.attr('ctxname')).displayFormUrl+"?ID=" + tableId;
                    //$(this).find('a').before("<a href='" + url + "'><img class='mouseOverImg' src='/_layouts/images/OPENDB.GIF' height='8' width='8' border='0'></a>&nbsp;&nbsp;");
                }
                // Hover function
                $(this).parent().hover(function(e){
                    posX = e.pageX + 10;
                    posY = e.pageY + 15;
                    jLoadMe(url,posX,posY,listBaseType)
                },
                function(){
                    $("#jLoadMe").html('').hide();
                });
            }
        });
    });
}

$(document).ready(function() {
    // Add description above ms-bodyareaframe
    //if(hoverImgDescription!=''){
    //    $("#onetidPageTitle").append("<div style='font-size:xx-small;float:right;margin:-12 0 0 0'><img src='" + hoverImg + "' height='8' width='8'>&nbsp;" + hoverImgDescription + "&nbsp;</div>");
    //}
    $(".ms-bodyareaframe").append("<div id='jLoadMe' style='display:none;'></div>");
    window.onerror = handleError; // needed for IE
    initjLoadMe();
});

function handleError() { // fn needed for IE
    return true;
}

// Attaches a call to the function to the "expand grouped elements function" for it to function in grouped listview's
function ExpGroupRenderData(htmlToRender, groupName, isLoaded){
    var tbody=document.getElementById("tbod"+groupName+"_");
    var wrapDiv=document.createElement("DIV");
    wrapDiv.innerHTML="<TABLE><TBODY id=\"tbod"+groupName+"_\" isLoaded=\""+isLoaded+"\">"+htmlToRender+"</TBODY></TABLE>";
    tbody.parentNode.replaceChild(wrapDiv.firstChild.firstChild,tbody);
initjLoadMe();
}