Friday, 20 February 2009
WSS3.0: Update WSS List via webservices
This was ripped from - blog.crowe.co.nz
Step/Step - An example of updating a Windows Sharepoint Server List from c#
1) Open Visual Studio.NET 2003
2) New Project (We will create a console application in this demo)
3) Name your project "GetListItems"
4) Right Click on "References" under the Project and select "Add Web Reference"
5) In the URL field type the path to your Windows SharePoint Services Site that contains the list you want to use.
Each site is different and only contains the lists for the particular child site.
For example the root site could be called "http://sharepoint.mysite.com" and you could have a sub site called "Test" which is accessible via "http://sharepoint.mysite.com/Test"
So type in your URL and append the following "_vti_bin/lists.asmx"
So if you were going to the "Test" child site your URL would be like this:
http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx
You may be prompted to log onto your SharePoint site when do perform this action.
6) Click on "Go" and the Add Web Reference Dialog should display that it found one service and display you some available operations.
7) Click on "Add Reference"
8) Now you should end up with a new Web Reference Node in the Solution Explorer and your actual Web Reference which may have a funny name like "com.mysite.sharepoint"
9) Right click on the Web Reference and rename it to something simple like "SharePoint", this is what we will use to reference the web service in code.
10) Right click on the Web Reference and select "Properties" and change the "URL Behavior" to "dynamic"
This will add a "app.config" to the project and populate an appSettings item in the config file so that the URL is dynamically loaded from the "app.config" file and not hard coded into the source of the proxy stub that was created.
xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="GetListItems.Sharepoint.Lists" value="http://sharepoint.mysite.com/Test/_vti_bin/lists.asmx"/>
</appSettings>
</configuration>
11) Open the Class1.cs file in the editor and enter the following:
using System.Net;
using System.Xml;
namespace GetListItems
{
///
/// Summary description for Class1.
///
class Class1
{
///
/// The main entry point for the application.
///
[STAThread]
static void Main(string[] args)
{
string Username="UserName";
string Password="Password";
string Domain="Domain";
string ListName = "ListName";
Sharepoint.Lists ListsService = new Sharepoint.Lists();
ListsService.Credentials = new NetworkCredential(Username, Password, Domain);
// Create a new XML document to hold the updates we are going to perform
XmlDocument doc = new XmlDocument();
XmlElement updates = doc.CreateElement("Batch");
updates.SetAttribute("OnError", "Continue");
// We need to Create a Method Tag for each row we are going to update.
XmlElement UpdatesMethod = doc.CreateElement("Method");
UpdatesMethod.SetAttribute("ID", "1");
UpdatesMethod.SetAttribute("Cmd", "Update");
updates.AppendChild(UpdatesMethod);
// We need to update a particular row based on its internal ID.
XmlElement UpdatesField1 = doc.CreateElement("Field");
UpdatesField1.SetAttribute("Name", "ID"); // Which record to update
UpdatesField1.InnerText = "1"; // is defined here
UpdatesMethod.AppendChild(UpdatesField1);
// We are going to update the field called "Status"
XmlElement UpdatesField2 = doc.CreateElement("Field");
UpdatesField2.SetAttribute("Name", "Status"); // Which field to update
UpdatesField2.InnerText = "Status is OK"; // The actual new value
UpdatesMethod.AppendChild(UpdatesField2);
// Call the web service to update the list items
XmlNode Result = ListsService.UpdateListItems(ListName, updates);
ListsService.Dispose();
Console.WriteLine("The record has been updated!");
// Sleep for a moment so we can see the results
System.Threading.Thread.Sleep(5000);
}
}
}
Make sure you populate the Username, Password, Domain, and ListName variables above. You also need to make sure that the field “Status” exists in the particular list that you are updating. If it does not you will need to change it to a field that does exist.
For some sample code that will allow you to display the attribute names in a list see - /archive/2005/08/10/197.aspx
The XmlNode called Result should be parsed to locate errors that may have occurred during the update.
Tuesday, 17 February 2009
Javascript: Bubble Sorting
Very cool and works flawlessly.
http://www.the-art-of-web.com/javascript/oopsort/
Monday, 2 February 2009
WSS3.0: Deploy Master Pages to Subsite
But after further digging around, I found a nicely written solution by Stramit on codeplex.
If you download the non-source v1.1 release, there is a flaw in the batch install and i was scratching my head as to why i'm not seeing the link everyone else was under site settings.
Trick is to download the source version and then read the thread below to fill out the gaps.
http://www.codeplex.com/SPMasterPicker/Thread/View.aspx?ThreadId=43375
Once the install complete, the tool works a charm, thanks Stramit.
Friday, 23 January 2009
WSS3.0: Default Features List
33 Features in WSS v3
* AdminLinks
* AnnouncementsList
* BasicWebParts
* ContactsList
* ContentLightup
* ContentTypeSettings
* ctypes
* CustomList
* DataSourceLibrary
* DiscussionsList
* DocumentLibrary
* EventsList
* fields
* GanttTasksList
* GridList
* IssuesList
* IssueTrackingWorkflow
* LinksList
* MobilityRedirect
* NoCodeWorkflowLibrary
* PictureLibrary
* SiteSettings
* SPSearchFeature
* SurveysList
* TasksList
* TeamCollab
* UpgradeLinks
* WebPageLibrary
* WikiWelcome
* WorkflowHistoryList
* WorkflowProcessList
* XmlFormLibrary
Microsoft Office SharePoint Services 2007 Features:
107 Features Added in MOSS 2007*
* AddDashboard
* Analytics
* AnalyticsLinks
* BaseSite
* BaseSiteStapling
* BaseWeb
* BaseWebApplication
* BDCAdminUILinks
* BDR
* BizAppsCTypes
* BizAppsFields
* BizAppsListTemplates
* BizAppsSiteTemplates
* BulkWorkflow
* BulkWorkflowTimerJob
* DataConnectionLibrary
* DataConnectionLibraryStapling
* DeploymentLinks
* DMContentTypeSettings
* EawfSite
* EawfWeb
* EnhancedHtmlEditing
* ExcelServer
* ExcelServerSite
* ExcelServerWebApplication
* ExpirationWorkflow
* FeaturePushdown
* GlobalWebParts
* GradualUpgrade
* Hold
* ipfsAdminLinks
* IPFSAdminWeb
* IPFSDocumentConversion
* IPFSSiteFeatures
* IPFSWebFeatures
* LegacyDocumentLibrary
* ListTargeting
* LocalSiteDirectoryControl
* LocalSiteDirectoryMetaData
* LocalSiteDirectorySettingsLink
* MasterSiteDirectoryControl
* MigrationLinks
* MySite
* MySiteBlog
* MySiteCleanup
* MySiteHost
* MySiteLayouts
* MySiteNavigation
* MySiteQuickLaunch
* Navigation
* NavigationProperties
* OffWFCommon
* OSearchBasicFeature
* OSearchCentralAdminLinks
* OSearchEnhancedFeature
* OSearchPortalAdminLinks
* OSearchSRPAdminLinks
* OsrvLinks
* OsrvTasks
* OssNavigation
* OSSSearchSearchCenterUrlFeature
* OSSSearchSearchCenterUrlSiteFeature
* PageConverters
* PortalLayouts
* PremiumRootSite
* PremiumRootSiteStapling
* PremiumSite
* PremiumSiteStapling
* PremiumWeb
* PremiumWebApplication
* ProfileSynch
* Publishing
* PublishingLayouts
* PublishingPrerequisites
* PublishingResources
* PublishingSite
* PublishingStapling
* PublishingWeb
* RecordsManagement
* RedirectPageContentTypeBinding
* RelatedLinksScopeSettingsLink
* ReportCenterCreation
* ReportCenterSampleData
* Reporting
* ReportListTemplate
* ReviewWorkflows
* SearchAndProcess
* SearchWebParts
* SharedServices
* SignaturesWorkflow
* SitesList
* SkuUpgradeLinks
* SlideLibrary
* SlideLibraryActivation
* SpellChecking
* SPSDisco
* SpsSsoLinks
* SRPProfileAdmin
* StapledWorkflows
* TranslationWorkflow
* TransMgmtFunc
* TransMgmtLib
* UpgradeOnlyFile
* UserMigrator
* ViewFormPagesLockDown
* WebPartAdderGroups
* Two additional features are installed when you upgrade from MOSS 2007 Beta 2 to MOSS Beta 2 Technical Refresh: PublishingB2TRHop2SiteFilesUpgrade & PublishingB2TRSiteFilesUpgrade. These two Features, as their names imply, are used to upgrade some of the publishing files from Beta 2 to Beta 2 Technical Refresh. This also explains why you may have experienced some problems with your existing Publishing sites created in Beta 2 after upgrading to Beta 2 Technical Refresh, as outlined in this post. Because they are upgrade Features, and not likely to be present in the RTM release of MOSS 2007, I am not including them in the count.
Tuesday, 20 January 2009
WSS3.0: Search Scope not showing up
The scenario you've described is completely possible. It will take a few steps, and I'm happy to walk you through them.
For others reading this thread, when beginning an upgrade from WSS 3.0 to Search Server, your best bet is to follow along with the steps in the document "Upgrade to Search Server 2008 from Windows SharePoint Services 3.0"
In that doc, in the section titled "Activate features for Web applications carried over to Search Server", ensure you've followed these steps:
After you install Search Server over Windows SharePoint Services, you must activate features for the Windows SharePoint Services Web applications that were carried over to Search Server. Use the following procedure to activate features for these Web applications.
To activate features for Web applications carried over to Search Server
- From the Central Administration Web site, click Application Management.
- On the Application Management page, under SharePoint Web Application Management, click Manage Web application features.
- On the Manage Web Application Features page, click a Web application.
- Next to the description for Office Server Enterprise Search, click Activate.
- Next to the description for Office Server Site Search, click Activate.
- Repeat steps 3 through 5 for each Web application listed on the Manage Web Application Features page.
Reading this document again, I've noticed that there's a key step missing in order to make your legacy search boxes take advantage the new Search Center experience. I'll request the document be updated to include the following steps.
For each WSS Site Colleciton that existed prior to the upgrade, complete these steps:
1. As a site collection administrator, click on "Site Actions > Site Settings".
2. There will be some new links in the Site Collection Administration column which have appeared as a result of activating the features. Click on "Search Settings"
3. (Now I admit that this page is not intuitive. Just take my word here for what it does...)
There are two radio buttons. Select the one called "Use Custom Scopes".
In the text box, type in the address of your Search Center. The exmple given on that page might be a little misleading. If your the new Search Server Search Center query page is http://[servername]:[port]/default.aspx and the results page is http://[servername]:[port]/resutls.aspx, you can just type in http://[servername]:[port]
Now, if you navigate to a page in your original WSS Site, you should see the following changes:
1. The Scopes Dropdown now includes "All Sites". (You can add more scopes by using the Search Scopes link which is directly below "Search Settings" in Site Collection Administration)
2. When you type in a query, it should now show the results in the Search Center's results.aspx page.
REF: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=3020163&SiteID=17
Friday, 16 January 2009
Thursday, 8 January 2009
Sysadmin: Free Busy Http Request
Output:
<a:response xmlns:a="WM">
<a:recipients>
<a:item>
<a:displayname>All Attendees</a:displayname>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
<a:item>
<a:displayname>Joe Blogs</a:displayname>
<a:email type="SMTP">jb@jb.com.au</a:email>
<a:type>1</a:type>
<a:fbdata>00000000000020010030</a:fbdata>
</a:item>
</a:recipients>
</a:response>
Response results are broken into half hour timeslots from 7 AM to 5 PM.
These half hour slots return a single integer.
0 means Free
1 means Tentative
2 means Busy
3 means Out of Office
4 means Unable to find you in exchange dude!
Sunday, 4 January 2009
Sysadmin: Standby System using command line
%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState