- Introduction to SharePoint for .NET Developers - Event Handler
- Introduction to SharePoint for .NET Developers - Silverlight
- Introduction to SharePoint for .NET Developers - Data List
- Introduction to SharePoint for .NET Developers - Web Services
- Introduction to SharePoint for .NET Developers - Custom Content Type
- Introduction to SharePoint for .NET Developers - User Management
- Introduction to SharePoint for .NET Developers - Workflows
- Introduction to SharePoint for .NET Developers - Page Branding
- Introduction to SharePoint for .NET Developers - Page Navigation
Thursday, July 24, 2008
MSDNs' 10 part Webcasts Series
Monday, July 21, 2008
Certified Distributed Application developer!!!!
Wish me luck!! ..and some good content if you think can help me..you know where to ping me!!
Saturday, July 19, 2008
Date Picker control for Sharepoints' ghosted application pages
This was the thing, one of my client needed a ghosted application page available across site collections. The form, as usual, had data fields one of which happened to be Date field.
Well, no problem, we very well have Sharepoints' DateTimeControl to do that job, dont we??. Only when i was testing the form, when i realized that control needs the required Javascript files on the page. referencing /_layouts/DatePicker.js dint quite solved my problem. On little research, i found out, there were couple of more javascript files that needs to be referenced on the page. Couldn't exactly nail till now..which. I was still doing a little research on net, when i found this cool ASP.NET datepicker control on my hard drive. Hell, dont even now from where and when did i downloaded this thing, but its cool. It was a little raw. i Sharepoint-ized the control and decorated it a little bit and showed it to my client as a temporary fix asking for sometime till i knock how to get DateTimeControl working on ghosted application pages. But it seems my client found this control cooler than Sharepoints' DatePicker. Frankly, this guy is really cool. I have put this thing up here as a CodePlex project.
Thursday, July 17, 2008
Multiple Performance and Infrastructure updates for (SharePoint) WSS 3.0
Update from Shelton blog:
The office team has just released a Infrastructure and Performance update for Windows SharePoint Server 3.0 (WSS 3.0). Anything to improve the performance of SharePoint in my Virtual PC environment is welcome! My physical servers run beautifully, but running multiple Virtual PC’s on a dual-core laptop and trying to show demonstrations of SharePoint development can be a challenge at times. Enough about my problems and on to the links for both the 32bit (x86) and 64bit (x64) installations of WSS 3.0.
The first update addresses the following issues from KB951695:
The Infrastructure Update for Windows SharePoint Services 3.0 (KB951695) includes the latest performance updates and fixes for Microsoft Windows SharePoint Services 3.0.
Key updates for Windows SharePoint Services 3.0 include:
- Platform performance improvements and fixes.
- Several backup and restore fixes.
- Several core Workflow fixes.
To download the 32bit version: Click here
To download the 64bit version: Click here
The second update addresses the following issues from KB951297:
The Infrastructure Update for Microsoft Office Servers (KB951297) includes several new Enterprise Search features for SharePoint Server 2007 and the latest performance updates and fixes for the Microsoft Office Servers listed in the system requirements section below.
Key updates for SharePoint Server 2007 include:
- New Search features such as federated search and a unified search administration dashboard.
- Several core fixes to Search to improve performance and scale.
- Platform performance improvements and fixes.
- Several core fixes to the publishing Content Deployment features to improve reliability.
Key updates for Project Server 2007 include:
- Timesheets and My Tasks stability and usability improvements
- Queue management user interface improvements
- Project Server 2003 to Project Server 2007 migration fixes
- Database performance improvements to enhance the cube building process and Project Professional Save/Publish scenarios
To download the 32bit version: Click here
To download the 64bit version: Click here
Wednesday, July 16, 2008
The Autopsy Series for WSS 3.0
The Autopsy series wherein i would explain tiniest of the thing i can understand at the remotest location in th CAML.
First stop.....Autopsy - List definition
Dynamic dropdown as webpart custom property
Cool Downloadable stuffs for Sharepoint
(You can download Fiddler from here)
Saturday, July 12, 2008
List of LINQ Providers
Here’s the list:
How to Videos: Windows Presentation Foundation
I am starting to research Windows Presentation Foundation for a demonstration that I am working on and one of the resources that I was pointed to was the 3 videos that I am linking to below. In addition to that, there are some Virtual Labs, provided by Microsoft, that look promising. After I’ve gone through them, I will post the ones that I think are descent (from my perspective). In the meantime, check out these videos, when you have some time, especially the first one, if you are a beginner on the subject like I am.
Build a Standard WPF Application
8 minutes, 25 seconds
Creating Navigation Applications in WPF
11 minutes 45 seconds
Friday, July 11, 2008
Hands on Labs for Developing Applications on WSS 3.0 (SharePoint)
Here's a free set (10 of them) Hands on labs for Developing applications for Windows SharePoint Services 3.0 using Visual Studio 2005 (they will also work for Visual Studio 2008).
Here's a overview of the labs:
A set of 10 Hands on Labs for developing Applications for Windows SharePoint Services 3.0 with Visual Studio 2005. These labs are provided in C# and VB.NET languages. Each Hands on Lab is expected to take 60 minutes to complete and no SharePoint development experience is required. Participants are expected to have .NET development experience. The download includes lab manuals, completed lab exercises and any resource files required by the labs. The HOLs included are:
To download the labs: Click here
1. Web Parts
2. Data Lists
3. Event Handlers
4. Workflow
5. Silverlight
6. Page Navigation
7. Page Branding
8. Web Services
9. Content Types
10. User Authentication
Free utility: Windows Remote Desktop connection for the Apple Macintosh
Remote Desktop Connection Client for Mac 2 lets you connect from your Macintosh computer to a Windows-based computer or to multiple Windows-based computers at the same time. After you have connected, you can work with applications and files on the
Windows-based computer.
To learn about what's new in Remote Desktop connection Client for Mac 2, please visit the Microsoft Web site at www.microsoft.com/mac.
Here’s the download location: Click here
Wednesday, July 09, 2008
SPSiteDataQuery Vs. CrossListQueryInfo
No body really thought of comparing these two guys.. i heared people always comparing SPSiteDataQuery and PortalSiteMapProvider. Good post by Tone Stegeman:
When I was writing the querying part of the new Content By Type webpart that I will introduce shortly, I noticed there are 2 ways you can use to query SharePoint sites for content. The first is well known and described in a lot of articles on the web. In the method we use the SPSiteDataQuery object to get the data we want. Below you find an example.
string lists = "<Lists BaseType=\"5\" />";
string viewFields = "<FieldRef Name=\"Title\" />";
string webs = "<Webs Scope=\"SiteCollection\" />";
SPSiteDataQuery siteQuery = new SPSiteDataQuery();
siteQuery.Lists = lists;
siteQuery.ViewFields = viewFields;
siteQuery.Webs = webs;
results = SPContext.Current.Web.GetSiteData(siteQuery);
This query returns the title of all items in Issue lists in all sites in the current site collection. Nothing special here. This method of crawling for content works in both WSS and in MOSS. If you are running Microsoft Office SharePoint Servers, you can also use the CrossListQueryInfo object to query for content. The advantage is that SharePoint has a caching mechanism for the queries that you run. By
using CrossListQueryInfo, your webpart will use this caching mechanism. And you can also make use of audience targeting. See this link for more info.
The query of the previous example now looks like this:
string lists = "<Lists BaseType=\"5\" />";
string viewFields = "<FieldRef Name=\"Title\" /><FieldRef Name=\"ContentType\" />";
string webs = "<Webs Scope=\"SiteCollection\" />";
CrossListQueryInfo query = new CrossListQueryInfo();
query.RowLimit = 100;
query.WebUrl = SPContext.Current.Site.ServerRelativeUrl;
query.Lists = lists;
query.Webs = webs;
query.Query = "<Where><Neq><FieldRef Name=\"ContentType\" /><Value Type=\"Text\"></Value></Neq></Where>";
query.ViewFields = viewFields;
CrossListQueryCache cache = new CrossListQueryCache(query);
results = cache.GetSiteData(SPContext.Current.Site);
Please not that for this query I added a where statement to the query. This just checks for items that have a value in the ContentType field. If you don't specify a query, the GetSiteData method will generate an error message.
A warning if you are querying your sites using field names instead of IDs. When testing my Content By Type webpart, I started querying using the field names (SPField.InternalName) that I got from the site columns that are attached to the content type. I found that there are a number of issues with this. The internal name of the site columns are not exactly the same as the internal names of the fields that are used in the lists. This is caused by little differences in the site column features and the schema XML files for the lists. the Task content type for example contains a field with internal name "TaskDueDate" The Task lists in your sites however have a field called "DueDate". If you query using TaskDueDate, you will not get the results you expeect. Below you find these exceptions:
- Task: TaskDueDate in content type is called DueDate in list
- Task: TaskStatus in content type is called Status in list
- Issue: IssueStatus in content type is called Status in list
- Contact: EMail in content type is called Email in list
- Picture: Comments in content type is called Description in list
So I ended up querying using the ID guid of the fields. This applies to both methods described above.
Video: Building Simple Custom Approval Workflows with InfoPath 2007
else did it, I would "socialize" it via this blog.
Here's the download location: Click here
How to video: Building Web Parts with User Controls and AJAX
The Ted Pattison group has released a video on how to build AJAX-enabled web parts, using a real-world example. It’s a video goes into some depth, considering the subject, and will shorten your learning process a bit, so I thought that it was worthy of sharing.
Here’s the overview (from the site):
Learn about building Office SharePoint Server Web Parts with user controls and AJAX. Walk through a real-world example of separating your UI from your code-behind, using user controls to create input panels. Also, learn about using the AJAX update panel.
To download the video: Click here
Tuesday, July 08, 2008
8 New ASP.NET How to videos
The ASP.NET community has released some new videos for June, ranging from how to “Detect Browser Capabilities in ASP.NET Web Pages” to “Managing the look and feel of Silverlight 2 controls”. They always do a great job, so check these out when you get a chance!
How Do I: Map an ASP.NET Server Control to the Adaptor Used to Render It
In this video Chris Pels will show how to use a control adaptor to provide different renderings for an ASP.NET server control without actually changing the control itself. In this video, an ASP.NET BulletList control will be adapted to display each list item horizontally using <div> elements instead of the traditional <ul> elements. First, see how to create a class that inherits WebControlAdaptor and then implements the code to render the new list format. Next, learn how to map the new control adaptor to the ASP.NET ,server control in the .browser definition file. Then see how to use the new control adaptor on pages in a web site. Finally, learn how a control adaptor can be associated with either all browsers or specific types of browsers.
How Do I: Detect Browser Capabilities in ASP.NET Web Pages
In this video Chris Pels will show how to determine what capabilities a user’s browser has when viewing pages in an ASP.NET web site. First, learn how to access an instance of the HttpBrowserCapabilities object from the ASP.NET Request object associated with the web page request.
Next, see the different information available in the HttpBrowserCapabilities object such as the type of browser and whether the user’s browser supports JavaScript and Cookies. Then see an example of how to user this information about the user’s browser and determine if a crawler is accessing the web site so it can be redirected to a
crawler specific web page.
How Do I: Work with Nested Master Pages to Create Standard Content Layouts
In this video Chris Pels will show how to use nested master pages to create individual master pages that represent different standard content layouts for a web site. First, see how several major commercial web sites use a standard set of content layouts. Next, see how to nest a master page within another master page, and use the design time support in Visual Studio 2008. Then, learn the considerations for establishing a “page architecture” which represents the major types of content layout used in a sample web site. Once that definition is complete see how to structure the nested master pages so developers can then select a master page, resulting in a standardized and consistent display of content for a web site.
Using Styles and Templates to manage the look and feel of Silverlight 2 Controls
Programming a Full-Blown AJAX Enterprise Application in 20 Minutes
It is all about simplicity when programming next–generation, complex Asynchronous JavaScript and XML (AJAX) applications. In this webcast, we develop a fully blown AJAX enterprise application by dragging and dropping controls using Windows Forms Designer and the Gizmox Visual
WebGui (VWG) framework. We extend, customize, and invoke client resources, and we demonstrate how you can cut your development cycle by as much as 90 percent. Visual WebGui is open source, so you can dive into the code.
Web Application Projects vs. Web Site Projects in Visual Studio 2008
In this webcast, by request, we examine the differences between Web application projects and Web site projects in Microsoft Visual Studio 2008. We focus specifically on the reasons you would choose one over the other and explain how to make informed decisions when creating a Web solution. Come and see this death-defying cage match!
SQL Injection Code Analyzer
Microsoft has just released a free utility to help developers
analyze ASP code for SQL Injection vulnerabilities. Earlier this year,
several public sites went down when hackers unleashed a series of bots
to find and exploit servers where developers did not correctly code
their applications/pages to prevent SQL Injection attacks.
Here’s what the utility offers (from the original page):
In
response to the recent mass SQL injection attacks, Microsoft has
developed a new static code analysis tool for finding SQL Injection
vulnerabilities in ASP code. Web developers can run the tool on their
ASP source code to identify the root cause of the attack and address
them to reduce their exposure to future attacks. The tool will scan ASP
source code and generate warnings related to first order and second
order SQL Injection vulnerabilities. The tool also provides annotation
support that can be used to improve the analysis of the code.
Here’s the download location: Click here
Newly Updated Tools for SharePoint Developers using Visual Studio 2008 (Version 1.2)
The User Guide for this tool can be found here: Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions User Guide, Version 1.1
The 1.1 version can be found here for Visual Studio 2005 support: Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions, Version 1.1
Version 1.2 of the Visual Studio 2008 Extensions for Windows SharePoint Services contains the following tools to aid developers in building SharePoint applications:
Visual Studio 2008 Project Templates
- Web Part
- Team Site Definition
- Blank Site Definition
- List Definition
- Empty SharePoint Project
Visual Studio 2008 Item Templates (items that can be added into an existing project)
- Web Part
- Custom Field
- List Definition (with optional Event Receiver)
- Content Type (with optional Event Receiver)
- Module
- List Instance
- List Event Handler
- Template
SharePoint Solution Generator
- This stand-alone program generates a Site Definition project from an existing SharePoint site. The program enables developers to use the browser and Microsoft Office SharePoint Designer to customize the content of their sites before creating code by using Visual Studio.
Note: This download does not work with an x64 OS. We currently recommend a x86 development machine for SharePoint development when targeting x64 OS for test and production. Output binaries are all .NET assemblies so you can reasonably expect all .NET assemblies built on the x86 dev box to still work on your x86 OS test and production machines. The CLR will JIT compile the .NET assembly on each target machine and will optimize for x64 OS when run on that architecture. Testing on x64 after doing development on x86 is still recommended.
Here’s the download location: Click here
Friday, July 04, 2008
Get Current User for Infopath and set file name - PART II
In Last Post, we saw that how we get the current users' profile in form open.
In this post, we'll see how to save the Infopath Form in Library with a predefined file name formed from the fields. In our case, we'll have it is:
productName_ExpectedDate_CurrentUser
1. So, lets get back to our ProductRequestForm.xsn:
2. In browser forms by default, we have the options on the top to Save, Save As.., Update, PrintView,etc:
When you say Save, it gives you a pop for file name:
This is something you dont want if you are to save the file with predefined name.
3. In the Infopath Form (in design mode), Go to Tools -> Form Options -> Browser and uncheck Show toolbar at top of form and Show toolbar at bottom of form and check refresh the form before submitting it if form data might change during processing
4. Now we'll come on the Save and Cancel buttons we'd put on the form before. What we want here is on click of the save button, we want the file to be saved with the format as mentioned by concatenating the form field Data. For this we had to write some rules. Before that, we'll create a Submit Data Connection. Go to Design Tasks -> Data Source -> Manage Data Connections... -> Add... to open the Data Connection Wizard.
a. Choose Create a new connection to: Submit data
b. From Destination, choose To a document library on a Sharepoint site
c. Here, Enter the full Library URL and click on the formula builder: 'fx' button and from the Main data source, choose filename field
d. Name your connection as SetFileNameSubmit and click Finish to have the submit connection ready.
5. Now we'll come on to Save button and set some Rules.
Right Click the Save Button -> Button Properties... -> Rules -> Add..., give a name for the rule, say, SaveFileName and click Set Condition... to open a Condition Filter Dialog and set the query as below:
This is to ensure that the user has entered the right values before the save could proceed. As can be seen, if any of the one query is not satisfied, the save button wont proceed
6. Now, if everything is fine and the query is fulfilled, then we would like to add the Save form and close action. However, before this could be done, if you remember, we had just made a Submit data source and had chosen fileName field to be the name of the file. But for this, there has to be some value in that field before it could be used as a fileName.
Lets go ahead and add a Set a field's value action.
In "Field:" text box, select fileName field from the Main data Source and in "Value:" text box, choose the 'fx' (formula builder). Enter a formula to concatenate the fields' values:
concat(products,"_",expectedDate,"_",CurrentUserName) like this:
NOTE: the Underlined field are result of select from Insert Field or Group... from Main Data Source
7. Click Ok, to come back on the main Rule Dialog. Now there is a catch here that has different ways of going about. When we save the form, its all ok and the form is saved with desired name. But if someone reopens the form and change the values of the fields involved in file naming, infopath is not intelligent enough to understand this and rename the file. Instead, it creates a new copy with newer values. For this:
a. Either we lock the fields that are dynamically forming the fileName on the first Virgin Save so that the consequent modifications ensures that these fields are not changed and hence the file name.
OR
b. We knock off the old file through Querying with CAML either in Library's Item Event Handlers or some other place that you find more feasible.
I choose to lock the fields after the file is saved and hence we created a field in the Main data source called IsFormLocked. We'll go ahead and set this field value to TRUE or 1 and then set Conditional Formatting on the controls to disable on open if they found value of this field as TRUE or 1. This will ensure that the values are never changed
8. Now add two more Actions to
a. Submit using a Data Connection and choose SetFileNameSubmit connection we just created.
9. Finally add an action called Close the Form.
Your action list for this rule should look something like this:
10. Also set simple Close the form action for Cancel Button.
11. Now, in each of the controls'properties (those involved in setting the file name), set a Right Click the Control -> Conditional Formatting... -> Add... -> , set a Query like below to disable the control:
you would need to repeat this for controls mapped to each of these:products, expectedDate, CurrentUserName.
NOTE: for textbox and Datepicker, it would be read-Only
12. Also, if you rememeber, we had also made a section that had an error message in Red, we'll show this section when Button Save Query is not fullfiled. Or in other words, hide the control when Query is fulfilled.
13. For this go to the Section, Right Click -> Conditional Formatting... -> Add... and set the following query and select Hide this Control:
14. Now click on the Design Task -> Design Checker to see if there is any error. you might see one message saying Data connection contains parameterized query. Well, its nothing. its only saying that one of your receive connections needs a parameter and if you still remember, its the one that consumes UserProfileService.asmx
15. Now, i guess, we are good to go. Save the form and Publish it to SharePoint Library. I published it to a new document Library called Product Request Form Libary. You can do it to an existing library also. In any case, make sure the library is same as the one you entered in the textbox in the create new submit data connection wizard. The submit connection that we named here as SetFileNameSubmit
NOTE: Make sure that in Settings -> Form Library Settings -> Advanced Settings in Browser-enabled Documents section, Display as a web page is selected.
16. Now create a new Form item:
17. You'd see form open in browser like this:
fill in the appropiate details and see the error message go away.
18. Finally when you click save, you'd see the form item with the file name in the desired format as below:
So, in these two post, we saw how can we get current users' identity when form opens and also, how to give you form, a predefined file name.
Thursday, July 03, 2008
Get Current User for Infopath and set file name - PART I
Today we'll look at retrieving current users' Information as well as naming the infopath files using the fields on the form.
for the sake of length, I'll divide this post in two part.
In this part, we'll see how to get current users' profile properties in Infopath Browser forms using UserProfileService.asmx
Let's consider an example called Product Request Form where a particular sales employee of the company request for shipment of a particular product
1. First Open the Infopath( this can be done by simply typing 'infopath' in run prompt) and choose a blank template to start with. Make sure you have selected Enable Browser Compatible Features only
2. Add Following Fields to the Main Data source
products: Text
expectedDate: Date
CurrentUserName: Text
IsFormLocked: Boolean
fileName: Text
Error: Text
3. Create the form Layout as below:
Lets insert Some values in the products dropdown:
4. Firstly, we have to get the Current user's name in the Requesting User text box
and the text box be read-only. For this, we will consume the SharePoints' much hyped userprofileservice.asmx's method called GetUserProfileByName
5. For this, go to Design Task -> Data Source -> Manage Data Connections -> Add...
In the Wizard:
a. Choose Create a new connection to: Receive data
b. from the Source of Data, select Web Service
c. In Url, enter your Sites' url follwed by _vti_bin/UserProfileService.asmx
d. Out of the list of methods, choose GetUserProfileByName
e. In Next screen, you'll be asked for Account Name, leave it blank as doing so would get the current User.
f. Make sure in consecutive screens that Store a copy of the data in the form template is unchecked and Automatically retrieve data when form is open is checked
6. In the text box mapped to the field CurrentUserName, we would need to format the display value to that retrieved from UserProfileService.asmx
thats configured to populate its values on form Load. For this, go to Textbox's properties and in the Value field, go to formula builder by clicking fx
7. Click Insert Field or Group.... Choose the secondary receive data source we just created and select value field but don't click Ok yet!!
8. Instead, click on Filter Data... -> Add... to open the filter condition dialog and choose Select a field or group...
9. Choose Name Field again from the Secondary Data Source just created:
10. In the second drop down, select is equal to and in the value drop down, choose Type a Text... and type AccountName
Note: you can choose from a list of profile properties you want:
UserProfile_GUID
AccountName
FirstName
LastName
PreferredName
WorkPhone
Office
Department
Title
Manager
AboutMe
PersonalSpace
PictureURL
UserName
QuickLinks
WebSite
PublicSiteRedirect
SPS-Dotted-line
SPS-Peers
SPS-Responsibility
SPS-Skills
SPS-PastProjects
SPS-Interests
SPS-School
SPS-SipAddress
SPS-Birthday
SPS-MySiteUpgrade
SPS-DontSuggestList
SPS-ProxyAddresses
SPS-HireDate
SPS-LastColleagueAdded
SPS-OWAUrl
SPS-ResourceAccountName
SPS-MasterAccountName
Assistant
WorkEmail
CellPhone
Fax
HomePhone
11. Finally, your formula should look something like this:
12. I Guess, this is it, for getting the current users' loginName.. you could have opted for any properties from the list of available properties above.
In the Next Post we'll see how to save the file with a predefined value.. might be.. a format like:
Product_creationDate_creatingUser
Tuesday, July 01, 2008
Posted from ScribeFire
This article was posted from Scribe fire.. its really cool way to blogging.