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.
Wednesday, November 17, 2010
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";
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
Using jQuery to fix the removal of the Title column of a 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:

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)”…

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:

“(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:

Or, as text:
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:

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:

(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/
You can make a Title column not required:
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)”…
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:
“(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:
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:
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:
(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 SpecialistIT ProSo 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.
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
MCM – Microsoft Certified Master
IT Pro / DevThe 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.
Microsoft Certified Master: Microsoft Office SharePoint Server 2007
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 2010MCITP – Microsoft Certified IT Professional
Exam 70-667: TS: Microsoft SharePoint 2010, Configuring
Developer, SharePoint Server 2010 Exam 70-573: TS: Microsoft SharePoint 2010, Application Development
SharePoint Server 2010MCPD– Microsoft Certified Professional Developer
Exam 70-668: PRO: SharePoint 2010, Administrator
Developer, SharePoint Server 2010MCM – Microsoft Certified Master
Exam 70-576: PRO: Designing and Developing Microsoft SharePoint 2010 Applications
IT Pro / DevAlthough 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.
Microsoft Certified Master: SharePoint Server 2010
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 DegreeI’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. :)
MCITP/MCPD = Bachelor’s Degree
MCM = Master’s Degree
MCA = Doctoral Degree
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:
http://blogs.technet.com/josebda/archive/2008/03/15/complete-reference-of-all-stsadm-operations-with-parameters-in-moss-2007-sp1.aspx
- stsadm -o activatefeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-url <url>] [-force]
- stsadm -o activateformtemplate -url <URL to the site collection> [-formid <form template ID>] [-filename <path to form template file>]
- 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>
- 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>]
- stsadm -o adddataconnectionfile -filename <path to file to add> [-webaccessible <bool>] [-overwrite <bool>] [-category <bool>]
- 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>]
- stsadm -o add-ecssafedataprovider -Ssp <SSP name> -ID <data provider id> -Type Oledb|Odbc|OdbcDsn [-Description <descriptive text>]
- stsadm -o add-ecstrusteddataconnectionlibrary -Ssp <SSP name> -Location <URL> [-Description <descriptive text>]
- stsadm -o add-ecsuserdefinedfunction -Ssp <SSP name> -Assembly <strong name|file path> -AssemblyLocation GAC|File [-Enable True|False] [-Description <descriptive text>]
- stsadm -o addexemptuseragent -name <user-agent to receive InfoPath files instead of a Web page>
- stsadm -o addpath -url <url> -type <explicitinclusion/wildcardinclusion>
- stsadm -o addpermissionpolicy -url <url> -userlogin <login name> -permissionlevel <permission policy level> [-zone <URL zone>] [-username <display name>]
- stsadm -o addsolution -filename <Solution filename> [-lcid <language>]
- stsadm -o addtemplate -filename <template filename> -title <template title> [-description <template description>]
- stsadm -o adduser -url <url> -userlogin <DOMAIN\user> -useremail <email address> -role <role name> / -group <group name> -username <display name> [-siteadmin]
- stsadm -o addwppack -filename <Web Part Package filename> [-lcid <language>] [-url <url>] [-globalinstall] [-force] [-nodeploy]
- stsadm -o addwppack -name <name of Web Part Package> [-lcid <language>] [-url <url>] [-globalinstall] [-force]
- 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>
- stsadm -o allowuserformwebserviceproxy -url <Url of the web application> -enable <true to enable, false to disable>
- stsadm -o allowwebserviceproxy -url <Url of the web application> -enable <true to enable, false to disable>
- stsadm -o associatewebapp -title <SSP name> [-default | -parent] -url <Web application 1 url,Web application 2 url> [-all]
- 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]
- stsadm -o backup -url <url> -filename <filename> [-overwrite]
- 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]
- stsadm -o backuphistory -directory <UNC path> [-backup] [-restore]
- stsadm -o binddrservice -servicename <data retrieval service name> -setting <data retrieval services setting>
- stsadm -o blockedfilelist -extension <extension> -add [-url <url>]
- stsadm -o blockedfilelist -extension <extension> -delete [-url <url>]
- stsadm -o canceldeployment -id <id>
- stsadm -o changepermissionpolicy -url <url> -userlogin <DOMAIN\name> [-zone <URL zone>] [-username <display name>] [{ -add | -delete } -permissionlevel <permission policy level>]
- stsadm -o copyappbincontent
- stsadm -o createadminvs [-admapidname <app pool name>] [-admapidtype <configurableid/NetworkService>] [-admapidlogin <DOMAIN\name>] [-admapidpwd <app pool password>]
- 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]
- stsadm -o creategroup -url <url> -name <group name> -description <description> -ownerlogin <DOMAIN\name or group name> [-type member|visitor|owner]
- 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>]
- 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>]
- 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>]
- stsadm -o createweb -url <url> [-lcid <language>] [-sitetemplate <site template>] [-title <site title>] [-description <site description>] [-convert] [-unique]
- stsadm -o databaserepair -url <url> -databasename <database name> [-deletecorruption]
- stsadm -o deactivatefeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-url <url>] [-force]
- stsadm -o deactivateformtemplate -url <URL to the site collection> [-formid <form template ID>] [-filename <path to form template file>]
- stsadm -o deleteadminvs
- stsadm -o deletealternatedomain -url <ignored> -incomingurl <protocol://incoming.url.domain>
- stsadm -o deletecmsmigrationprofile -profilename <profile name>
- stsadm -o deleteconfigdb
- stsadm -o deletecontentdb -url <url> -databasename <database name> [-databaseserver <database server name>]
- stsadm -o deletegroup -url <url> -name <group name>
- stsadm -o deletepath -url <url>
- stsadm -o deletepermissionpolicy -url <url> -userlogin <login name> [-zone <URL zone>]
- stsadm -o deletesite -url <url> -deleteadaccounts <true/false>
- stsadm -o deletesolution -name <Solution name> [-override] [-lcid <language>]
- stsadm -o deletessp -title <SSP name> [-deletedatabases]
- stsadm -o deletessptimerjob -title <SSP Name> -jobid <SSP Timer Job Id>
- stsadm -o deletetemplate -title <template title> [-lcid <language>]
- stsadm -o deleteuser -url <url> -userlogin <DOMAIN\name> [-group <group>]
- stsadm -o deleteweb -url <url>
- stsadm -o deletewppack -name <name of Web Part Package> [-lcid <language>] [-url <url>]
- stsadm -o deletezoneurl -url <protocol://existing.WebApplication.URLdomain> -urlzone <default, extranet, internet, intranet, custom> -resourcename <non-web application resource name>
- stsadm -o deploysolution -name <Solution name> [-url <virtual server url>] [-allcontenturls] [-time <time to deploy at>] [-immediate] [-local] [-allowgacdeployment] [-allowcaspolicies] [-lcid <language>] [-force]
- stsadm -o deploywppack -name <Web Part Package name> [-url <virtual server url>] [-time <time to deploy at>] [-immediate] [-local] [-lcid <language>] [-globalinstall] [-force]
- stsadm -o disablessc -url <url>
- stsadm -o displaysolution -name <Solution name>
- 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]
- stsadm -o editcontentdeploymentpath -pathname <path name> [-keeptemporaryfiles Never|Always|Failure] [-enableeventreceivers yes|no] [-enablecompression yes|no]
- 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>]
- stsadm -o email -outsmtpserver <SMTP server> -fromaddress <email address> -replytoaddress <email address> -codepage <codepage> [-url <url>]
- stsadm -o enablecmsurlredirect -profilename <profile name> -off
- stsadm -o enablessc -url <url> [-requiresecondarycontact]
- stsadm -o enumalternatedomains -url <protocol://existing.WebApplication.URLdomain> -resourcename <non-web application resource name>
- stsadm -o enumcontentdbs -url <url>
- stsadm -o enumdataconnectionfiledependants -filename <filename for which to enumerate dependants>
- stsadm -o enumdataconnectionfiles [-mode <a | u | all | unreferenced>]
- stsadm -o enumdeployments
- stsadm -o enumexemptuseragents
- stsadm -o enumformtemplates
- stsadm -o enumgroups -url <url>
- stsadm -o enumroles -url <url>
- stsadm -o enumservices
- stsadm -o enumsites -url <virtual server url> -showlocks -redirectedsites
- stsadm -o enumsolutions
- stsadm -o enumssp -title <SSP name> [-default | -parent | -all]
- stsadm -o enumssptimerjobs -title <SSP Name>
- stsadm -o enumsubwebs -url <url>
- stsadm -o enumtemplates [-lcid <language>]
- stsadm -o enumusers -url <url>
- stsadm -o enumwppacks [-name <name of Web Part Package>] [-url <virtual server url>] [-farm]
- stsadm -o enumzoneurls -url <protocol://existing.WebApplication.URLdomain> -resourcename <non-web application resource name>
- stsadm -o execadmsvcjobs
- 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]
- 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]
- 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]
- stsadm -o forcedeleteweb -url <url>
- stsadm -o formtemplatequiescestatus [-formid <form template ID>] [-filename <path to form template file>]
- stsadm -o getadminport
- stsadm -o getdataconnectionfileproperty -filename <filename of the data connection file> -pn <property name>
- stsadm -o getformsserviceproperty -pn <option name>
- stsadm -o getformtemplateproperty [-formid <form template ID>] [-filename <path to form template file>] -pn <property name>
- 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)
- stsadm -o getsitedirectoryscanschedule
- stsadm -o getsitelock -url <url>
- stsadm -o getsiteuseraccountdirectorypath -url <url>
- stsadm -o geturlzone -url <protocol://incoming.url.domain>
- stsadm -o grantiis7permission
- 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]
- stsadm -o installfeature {-filename <relative path to Feature.xml from system feature directory> | -name <feature folder>} [-force]
- stsadm -o listlogginglevels [-showhidden]
- stsadm -o listregisteredsecuritytrimmers -ssp <ssp name>
- stsadm -o localupgradestatus
- 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>]
- 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>]
- stsadm -o migrateuser -oldlogin <DOMAIN\name> -newlogin <DOMAIN\name> [-ignoresidhistory]
- 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'
- stsadm -o osearchdiacriticsensitive -ssp <ssp name> [-setstatus <True|False>] [-noreset] [-force]
- stsadm -o preparetomove {-ContentDB <DatabaseServer:DatabaseName> | -Site <URL>} [-OldContentDB <uniqueidentifier>] [-undo]
- stsadm -o profilechangelog -title <SSP Name> -daysofhistory <number of days> -generateanniversaries
- stsadm -o profiledeletehandler -type <Full Assembly Path>
- stsadm -o provisionservice -action <start/stop> -servicetype <servicetype (namespace or assembly qualified name if not SharePoint service)> [-servicename <servicename>]
- stsadm -o quiescefarm -maxduration <duration in minutes>
- stsadm -o quiescefarmstatus
- stsadm -o quiesceformtemplate [-formid <form template ID>] [-filename <path to form template file>] -maxduration <time in minutes>
- stsadm -o reconvertallformtemplates
- stsadm -o refreshdms -url <url>
- stsadm -o refreshsitedms -url <url>
- 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 '~'>]
- stsadm -o registerwsswriter
- stsadm -o removedataconnectionfile -filename <filename to remove>
- stsadm -o removedrservice -servicename <data retrieval service name> -setting <data retrieval services setting>
- stsadm -o remove-ecsfiletrustedlocation -Ssp <SSP name> -Location <URL|UNC> -LocationType SharePoint|Unc|Http
- stsadm -o remove-ecssafedataprovider -Ssp <SSP name> -ID <data provider id> -Type Oledb|Odbc|OdbcDsn
- stsadm -o remove-ecstrusteddataconnectionlibrary -Ssp <SSP name> -Location <URL>
- stsadm -o remove-ecsuserdefinedfunction -Ssp <SSP name> -Assembly <strong name|file path> -AssemblyLocation GAC|File
- stsadm -o removeexemptuseragent -name <user-agent to receive InfoPath files instead of a Web page>
- stsadm -o removeformtemplate [-formid <form template ID>] [-filename <path to form template file>]
- stsadm -o removesolutiondeploymentlock [-server <server> [-allservers]
- stsadm -o renameserver -oldservername <oldServerName> -newservername <newServerName>
- stsadm -o renamesite -oldurl <oldUrl> -newurl <newUrl>
- stsadm -o renameweb -url <url> -newname <new subsite name>
- stsadm -o restore -url <url> -filename <filename> [-hostheaderwebapplicationurl <web application url>] [-overwrite]
- 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]
- 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>]
- stsadm -o retractsolution -name <Solution name> [-url <virtual server url>] [-allcontenturls] [-time <time to remove at>] [-immediate] [-local] [-lcid <language>]
- stsadm -o retractwppack -name <Web Part Package name> [-url <virtual server url>] [-time <time to retract at>] [-immediate] [-local] [-lcid <language>]
- stsadm -o runcmsmigrationprofile -profilename <profile name> [-skipanalyzer ] [-onlyanalyzer ] [-startover ] [-migratesincetime <DateTime string>] [-migrationfolder <path>] [-exportonly ] [-importonly ] [-htmldiff <path>]
- stsadm -o runcontentdeploymentjob -jobname <name> [-wait yes|no] [-deploysincetime <datetime>] (<datetime> as "MM/DD/YY HH:MM:SS")
- stsadm -o scanforfeatures [-solutionid <Id of Solution>] [-displayonly]
- stsadm -o setadminport -port <port> [-ssl] [-admapcreatenew] [-admapidname <app pool name>]
- stsadm -o setapppassword -password <password>
- stsadm -o setbulkworkflowtaskprocessingschedule -schedule <recurrence string>
- 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>]
- 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")
- stsadm -o setdataconnectionfileproperty -filename <filename of the data connection file> -pn <property name> -pv <property value>
- stsadm -o setdefaultssp -title <SSP name>
- stsadm -o set-ecsexternaldata -Ssp <SSP name> [-ConnectionLifetime <time in seconds>] [-UnattendedServiceAccountName <account name>] [-UnattendedServiceAccountPassword <account password>]
- stsadm -o set-ecsloadbalancing -Ssp <SSP name> [-Scheme WorkbookUrl|RoundRobin|Local] [-RetryInterval <time in seconds>]
- stsadm -o set-ecsmemoryutilization -Ssp <SSP name> [-MaxPrivateBytes <memory in MBytes>] [-MemoryCacheThreshold <percentage>] [-MaxUnusedObjectAge <time in minutes>]
- stsadm -o set-ecssecurity -Ssp <SSP name> [-FileAccessMethod UseImpersonation|UseFileAccessAccount] [-AccessModel Delegation|TrustedSubsystem] [-RequireEncryptedUserConnection False|True] [-AllowCrossDomainAccess True|False]
- stsadm -o set-ecssessionmanagement -Ssp <SSP name> [-MaxSessionsPerUser <number of sessions>]
- stsadm -o set-ecsworkbookcache -Ssp <SSP name> [-Location <local or UNC path>] [-MaxCacheSize <storage in Mbytes>] [-EnableCachingOfUnusedFiles True|False]
- stsadm -o setformsserviceproperty -pn <option name> -pv <option value>
- stsadm -o setformtemplateproperty [-formid <form template ID>] [-filename <path to form template file>] -pn <property name> -pv <property value>
- stsadm -o setholdschedule -schedule <recurrence string>
- 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>] }
- stsadm -o setpolicyschedule -schedule <recurrence string>
- 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)
- stsadm -o setrecordsrepositoryschedule -schedule <recurrence string>
- stsadm -o setsearchandprocessschedule -schedule <recurrence string>
- stsadm -o setsharedwebserviceauthn -ntlm | -negotiate
- 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")
- stsadm -o setsitelock -url <url> -lock <none | noadditions | readonly | noaccess>
- stsadm -o setsiteuseraccountdirectorypath -url <url> [-path <path>]
- stsadm -o setsspport -httpport <HTTP port number> -httpsport <HTTPS port number>
- stsadm -o setworkflowconfig -url <url> {-emailtonopermissionparticipants <enable|disable> | -externalparticipants <enable|disable> | -userdefinedworkflows <enable|disable>}
- stsadm -o siteowner -url <url> [-ownerlogin <DOMAIN\name>] [-secondarylogin <DOMAIN\name>]
- 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
- stsadm -o spsearchdiacriticsensitive [-setstatus <True|False>] [-noreset] [-force]
- stsadm -o sync {-ExcludeWebApps <web applications> | -SyncTiming <schedule(M/H/D:value)> | -SweepTiming <schedule(M/H/D:value)> | -ListOldDatabases <days> | -DeleteOldDatabases <days>}
- stsadm -o syncsolution -name <Solution name>] [-lcid <language>] [-alllcids]
- stsadm -o syncsolution -allsolutions
- stsadm -o unextendvs -url <url> [-deletecontent] [-deleteiissites]
- stsadm -o uninstallfeature {-filename <relative path to Feature.xml> | -name <feature folder> | -id <feature Id>} [-force]
- stsadm -o unquiescefarm
- stsadm -o unquiesceformtemplate [-formid <form template ID>] [-filename <path to form template file>]
- stsadm -o unregistersecuritytrimmer -ssp <ssp name> -id <0 - 2147483647>
- stsadm -o unregisterwsswriter
- stsadm -o updateaccountpassword -userlogin <DOMAIN\name> -password <password> [-noadmin]
- stsadm -o updatealerttemplates -url <url> [-filename <filename>] [-lcid <language>
- stsadm -o updatefarmcredentials [-identitytype <configurableid/NetworkService>] [-userlogin <DOMAIN\name>] [-password <password>] [-local [-keyonly]]
- stsadm -o upgrade {-inplace | -sidebyside} [-url <url>] [-forceupgrade] [-quiet] [-farmuser <farm user>] [-farmpassword <farm user password>] [-reghost] [-sitelistpath <sites xml file>]
- stsadm -o upgradeformtemplate -filename <path to form template file> [-upgradetype <upgrade type>]
- stsadm -o upgradesolution -name <Solution name> -filename <upgrade filename> [-time <time to upgrade at>] [-immediate] [-local] [-allowgacdeployment] [-allowcaspolicies] [-lcid <language>]
- 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]
- stsadm -o uploadformtemplate -filename <path to form template file>
- stsadm -o userrole -url <url> -userlogin <DOMAIN\name> -role <role name> [-add] [-delete]
- stsadm -o verifyformtemplate -filename <path to form template file>
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/
<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
//$(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)
<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 & 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 & 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> ");
}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> ");
}
// 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'> " + hoverImgDescription + " </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();
}
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> ");
}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> ");
}
// 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'> " + hoverImgDescription + " </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();
}
Friday, June 25, 2010
Redirecting a site in Sharepoint to another site
Redirect a SharePoint site by using the Content Editor Web Part
In the Content Editor Webpart and in the Source Editor in any sharepoint page from where the redirect should happend, add the following script:(1)automatic redirect:
<script language="JavaScript">
alert("This site has been moved to another location, please update existing bookmarks. You will be redirected momentarily.");
window.location.href="http://serverTobeRedirectTo"
</script>
(2)with specific timeframe set:
<script language="JavaScript">
function getgoing()
{
top.location="http://serverTobeRedirectTo";
}
if (top.frames.length==0)
{
alert("This site has been moved to another location, please update existing bookmarks. You will be redirected in 10 Seconds.!");
setTimeout('getgoing()',10000);
}
</script>
Links Referred:
http://www.endusersharepoint.com/2010/01/20/redirect-a-sharepoint-site-by-using-the-content-editor-web-part/
http://www.dnzone.com/go?565
Wednesday, June 9, 2010
Jquery - Reading Data from XML or JSON data types
(1) Upload files in document library upload json.json and Topics.xml in the root level site.
(2) JSON.JSON:
{
topics:{
topic:[
'Select Topic',
'1 - Testing Json!',
'2 - Analysis Statement',
'3 - Another element',
]
}
}
(3) TOPICS.XML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Topics>
<Topic>Select Topic</Topic>
<Topic>1 - Testing Json!</Topic>
<Topic>2 - Analysis Statement</Topic>
<Topic>3 - Another element</Topic>
</Topics>
(4) Jquery would be:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
//Binding Json Data using Jquery
$.getJSON('http://YourServer/DocumentLibrary/json.json', function(data)
{
var numItems = data.topics.topic.length // To Count the number of elements in particular node
//Iterate through all the elements in that particular node
for(i=1;i<numItems;i++)
{
$("<option value='SELECT'>" + data.topics.topic[i] + "</option>").appendTo("#ddlTopic");
//Binding it to another dropdown with id ddlTopic
}
});
//Binding XML data using Jquery
$.ajax(
{
type:"GET",
url:"http://YourServer/DocumentLibrary/Topics.xml",
dataType:"xml",
success:function(xml){
$(xml).find('Topic').each(function(){
var topic = $(this).text();
//Binding it to another dropdown with id ddTopic
$("<option value='SELECT'>" + topic + "</option>").appendTo("#ddTopic");
}); // end each() loop
} // end success
}); // end ajax()
});//end ready()
</script>
(2) JSON.JSON:
{
topics:{
topic:[
'Select Topic',
'1 - Testing Json!',
'2 - Analysis Statement',
'3 - Another element',
]
}
}
(3) TOPICS.XML:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<Topics>
<Topic>Select Topic</Topic>
<Topic>1 - Testing Json!</Topic>
<Topic>2 - Analysis Statement</Topic>
<Topic>3 - Another element</Topic>
</Topics>
(4) Jquery would be:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
//Binding Json Data using Jquery
$.getJSON('http://YourServer/DocumentLibrary/json.json', function(data)
{
var numItems = data.topics.topic.length // To Count the number of elements in particular node
//Iterate through all the elements in that particular node
for(i=1;i<numItems;i++)
{
$("<option value='SELECT'>" + data.topics.topic[i] + "</option>").appendTo("#ddlTopic");
//Binding it to another dropdown with id ddlTopic
}
});
//Binding XML data using Jquery
$.ajax(
{
type:"GET",
url:"http://YourServer/DocumentLibrary/Topics.xml",
dataType:"xml",
success:function(xml){
$(xml).find('Topic').each(function(){
var topic = $(this).text();
//Binding it to another dropdown with id ddTopic
$("<option value='SELECT'>" + topic + "</option>").appendTo("#ddTopic");
}); // end each() loop
} // end success
}); // end ajax()
});//end ready()
</script>
Subscribe to:
Posts (Atom)
