Tuesday, 24 January 2012

SharePoint List View (Calendar) Webpart Cross Site/Web Rendering with No Code Hack


These scenarios more likely to happened when working on restricted environment such as no custom development and the SharePoint Designer is only tool available.

For instance,

"Calendar list cannot be shared across other site collection or subsite with Calendar view mode"

Or

"This webpart is only work on current website context and when it used on other website the information is not the same"

If above sound familiar then this little non-coding hack maybe useful to you.

Here the pre-requisites:
  • SharePoint Designer (2007 or 2010 depend on your environment)
  • Basic Html editing skill.
  • A new minified masterpage.
  • A new page inherit from new minified masterpage.
  • SharePoint Page View Webpart.

Some of you may already aware what have to be done with above pre-requisites. You are right, we are going to create a new webpart page without any branding and loaded with Page View webpart (Iframe).

Here the steps:
  1. Create a new masterpage without any branding but leave the main place holder.
  1. Create a new webpart page and point it to newly create minified masterpage. This page has to be create on website that you wish to share. e.g. http://yoursharepointsite.com/pages/calendar.aspx
  1. Insert the Calendar webpart into page just created in step 2.
  1. You are almost there, go to the page that require the Calendar webpart to render and insert the Page View webpart. e.g. http://yoursharepointsite2.com/pages/pagerender.aspx
  2. Point the newly inserted Page View Webpart to http://yoursharepointsite.com/pages/calendar.aspx.
  3. Walah, done.

Limitation
  • The website which consume the content is assume to have same access permission to source website, otherwise credential is require for login.

Sunday, 6 November 2011

Node.js


The JavaScript web server framework.

You can re-use existing Javascript skill to write a server side application.

What does that mean to me if I am a SharePoint/ .Net Web developer?

You can write a quick and easy JavsScript application to access backend system, such as MS SQL, MySQL and many more. It is crossed platform!!

Or

You are looking a highly efficient and performance for concurrent application.

Do I need to write everything by myself?

Not really, that is many modules can plug into your application. Visit this for further details


Debugging?

Build-in debug framework  or third-party tools, e.g.  Node GDB or Node Inspector.

So, what is the benefits of using the Node.js?
  • No extra language to learn but Node’s syntax.
  • Scalable and parallel infrastructure.
  • Lightweight and memory efficient.
  • Crossed platform

To find out more about this great stuff

Saturday, 27 August 2011

Windows 7 with ReadyBoost - Perfect for Virtualization Development.


That is one cool feature in Windows 7 which not many people are aware (actually it existed in Windows Vista), which can improve the performance of VMs and host machine with fraction of cost. Let's me introduce it to you, ReadyBoost. Let me get the quote from Microsoft how they describe this feature.

"Want a simple way to speed up your PC?

Just plug in a USB flash drive or card and let ReadyBoost borrow it. ReadyBoost is designed to help when your PC's memory is running low. Low memory can make your computer sluggish because Windows, which needs a place to stash data, turns to the hard drive. Flash memory offers a speedier alternative.

ReadyBoost works with most flash storage devices. In Windows 7, it can handle more flash memory and even multiple devices—up to eight, for a maximum 256 gigabytes (GB) of additional memory.
"

I am using Windows 7 with ReadyBoost for three Windows Server 2008R2 machines (AD, SQL and SP2010) which configured for SharePoint 2010 and Fast Search. The outcome is very satisfied from results I done in PassMark benchmarking tool.

Here configuration details.
  • 8GB DDR3 Memory
  • i7 processor
  • ReadyBoost (32GB SSD with ESATA)
  • 7200RPM HDD
  • USB 2 for VMs

This is the result of SP2010 running without ReadyBoosts in host machine. The VM and host system response are very sluggish and in not workable condition.




After activated ReadyBoosts in host machine, the result has obvious improved and overall performance (VM and host) is  noticeable.



Of course experience/result may be vary depend on running applications or hardware configuration, but strongly recommended to try it out if you have any spare flash drive or SSD.

Wednesday, 3 August 2011

Ajax Toolkit's TabPanel/UpdatePanel and ReportViewer - panelCreated error

You may receive the error when using the Ajax toolkit and ReportViewer on the page, e.g.


This is because the Ajax control is conflict with the ReportViewer, it will works if you using the .Net ScriptManager. But because you need the ToolkitScriptManager for your Ajax controld, therefore this is not an option.

But that is work around/fix for this error, which is just simply change your ToolkitScriptManager to ScriptMode="Release" and it will work like charm.

Tuesday, 5 July 2011

Good tips for Developing SharePoint 2010 projects

1) All customisation have to be deployable and repeatable, such as using WSPs and features to deploy solution to SharePoint environment. NEVER do manual deployments or fixes, such as create a custom list, modify config file, update SharePoint site. As all these can be done in SharePoint API and scripted in most cases.

2) Implement automate deployment process to reduce possible human error, such as site creation and site configuration. This can be done by PowerShell, batch file, wsp or custom application. Example write a bespoke console application to export site hierarchy and contents, when deploy solution the bespoke application should reuse to create whole SharePoint site.

3) Make sure all SharePoint Services Objects were disposed correctly to avoid memory leak. Reference site http://msdn.microsoft.com/en-us/library/aa973248(v=office.12).aspx. And the tool to check objects were disposed correctly, http://archive.msdn.microsoft.com/SPDisposeCheck.

4) Do not try to customise any SharePoint site definition or template, all design and customization should be done by feature stapling or web provisioning event. Any customisation on SharePoint component is bad and not promised to compatible in future SharePoint release.

5) Custom coding should be done in Sandbox solution and this is because:
a. Better resource monitoring and controlling.
b. Compatible with Office 365.
c. Isolated, better security for farm.
http://msdn.microsoft.com/en-us/magazine/ee335711.aspx

6) Minified JS and CSS files, also consolidate them into two files to improve SharePoint rendering performance.

7) Using Model-View-Presenter (MVP), Model-View-Controller (MVC) or similar layer separation pattern to speed up development process. Using mocking framework to perform unit testing on SharePoint object. E.g TypeMock or Nmock. In my opinion the unit test should cover basic function tests with looses code, this will prevent chances to break test classes when code refactoring.

8) Make sure source and destination server are in same version and packages when using the SharePoint's content export/import. Such as same language pack, service pack, hotfixes.

9) Test, test and test before check-in into source control. Developer has full responsibility when check-in codes, he/she must fully tested their code and check-in with meaning comments.

10) Try to use the out-of-box features as much as possible, unless you have very strong reason not to do so otherwise developer should avoid using any custom database, codes or third parties components.

Wednesday, 4 May 2011

SharePoint 2010 Version Numbers with Cumulative Update

Please find the SharePoint 2010 version numbers table listed at below.


SP2010
(with download links)
Version
KB articles
public Beta (rel. 11/2009)
14.0.4536.1000
n/a
RTM (04/2010)
14.0.4763.1000
n/a
14.0.5114.5003
14.0.5123.5000
October CU 10
14.0.5128.5000
December. CU 10
14.0.5130.5002
14.0.5136.5002
14.0.5138.5001
The SharePoint 2010 SP1 is around the corner, Microsoft should release it sometime in June/July.

Thursday, 28 April 2011

SharePoint 2010 - Form Based Authentication with Claims Authentication Part 1/2

Here the summary of how-to configure form based authentication in SharePoint 2010.
  1. Install and configure membership provider, e.g sqlmembershipprovider.
  2. Create a new web application with claim authentication, alternatively update existing web application from basic to claims based.
  3. Configure the SharePoint IIS instance to consume membership provider.
  • (optional) create a custom login page (I will list it in part 2)

I am strongly suggest you try all these steps in test or dev environment first to avoid any unhappy result. :)

Install and configure membership provide
You can choose any membership provider for FBA and for simplicity I had picked SQL membership provider for my demonstration.

First of all, you need a SQL database and it can be Express or full version.

Run the aspnet_regsql.exe execute file from this location.

C:\Windows\Microsoft.NET\Framework64\v2.0.50727 (please note the drive may be varies)



Then select



Point the application to right database and any necessary username and password.



Click finish to complete the configuration



Create or update the Web Application

To create a new web application, go to Central Admin -> Application Management -> Web Application -> Create New Web Application.

Select Claims Based Authentication

(Note: You need the Claims Based Authentication for FBA)




Fill the FBA details  and you need these information in later stage, feel free to change it but make sure you write it down.




And fill the rest details of web application and then select "OK".


For update existing web application to Claims based, run this PowerShell script.

$webapp = Get-SPWebApplication "http://yourwebapplicationurl"
$webapp.UseClaimsAuthentication = "True"
$webapp.Update()


Configure SharePoint IIS instance to use the membership provider

Once above two steps are completed then we can start to configure SP instance in IIS to talk to our SQL memberhsip provider.

Go to Administrative Tools -> Internet Information Services (IIS) Manager.

Select your web instance from tree menu under Site



The first step you need to setup a connection strings first, select Connection String then Add.

Your connection string should be look like this


The server name is the server which we were installed membership provider database to, the database has to same as value put down in previous step.

 GO back to your IIS website root and select Providers.

Select .Net Roles from dropdown and click on Add.



Remember we put down the values in SharePoint Central Adminstration for Role manager in previous step? Now we have to enter it again in Name field and details as below.

Type: SQLRolePRovider
Name: FBARole
ConnectionStringName: FBACon
ApplicationName: /



Once finished then select .Net Users from feature dropdown and select Add.

Fill these values in new window opened.
Type: SQLMembershipProvider
Name: FBA
ConnectionStringName: FBACon
ApplicationName: /



Same steps have to apply on Central Adminstration v4  website and SecurityTokenServiceApplication web service.



Once all set, go to website and you should expect to see screenshot below if all went smoothly.



Select Windows to auto logon if you current user has permission.

You may ask "what if I don't want the login selection box appear when user visit SharePoint site?".

Then you can extend your SharePoint site and have Windows (Site A) and Form authentication (Site B) side-by-side, for those need access to Windows authentication they can access SharePoint site A and the rest for Site B.