About Me


  • Enterprise Solutions Architect with 11 years of experience
  • Expertise on Microsoft Technologies, ECM, Open Source, Mobility
  • Expertise on SharePoint 2010, MOSS 2007, .Net 4.0 & More
  • Solution Design, Capacity Planning, Performance Tuning, Disaster Recovery
  • Migration experience from Lotus Notes, Plum Tree to SharePoint & Microsoft Technologies

Saturday, March 29, 2008

Web 2.0 Design Patterns

In his book, A Pattern Language, Christopher Alexander prescribes a format for the concise description of the solution to architectural problems. He writes: "Each pattern describes a problem that occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice."
  1. The Long Tail
    Small sites make up the bulk of the internet's content; narrow niches make up the bulk of internet's the possible applications. Therefore: Leverage customer-self service and algorithmic data management to reach out to the entire web, to the edges and not just the center, to the long tail and not just the head.
  2. Data is the Next Intel Inside
    Applications are increasingly data-driven. Therefore: For competitive advantage, seek to own a unique, hard-to-recreate source of data.
  3. Users Add Value
    The key to competitive advantage in internet applications is the extent to which users add their own data to that which you provide. Therefore: Don't restrict your "architecture of participation" to software development. Involve your users both implicitly and explicitly in adding value to your application.
  4. Network Effects by Default
    Only a small percentage of users will go to the trouble of adding value to your application. Therefore: Set inclusive defaults for aggregating user data as a side-effect of their use of the application.
  5. Some Rights Reserved. Intellectual property protection limits re-use and prevents experimentation. Therefore: When benefits come from collective adoption, not private restriction, make sure that barriers to adoption are low. Follow existing standards, and use licenses with as few restrictions as possible. Design for "hackability" and "remixability."
  6. The Perpetual Beta
    When devices and programs are connected to the internet, applications are no longer software artifacts, they are ongoing services. Therefore: Don't package up new features into monolithic releases, but instead add them on a regular basis as part of the normal user experience. Engage your users as real-time testers, and instrument the service so that you know how people use the new features.
  7. Cooperate, Don't Control
    Web 2.0 applications are built of a network of cooperating data services. Therefore: Offer web services interfaces and content syndication, and re-use the data services of others. Support lightweight programming models that allow for loosely-coupled systems.
  8. Software Above the Level of a Single Device
    The PC is no longer the only access device for internet applications, and applications that are limited to a single device are less valuable than those that are connected. Therefore: Design your application from the get-go to integrate services across handheld devices, PCs, and internet servers.
Reference: http://www.oreilly.com/pub/a/oreilly/tim/news/2005/09/30/what-is-web-20.html

Custom Script while submiting a list item in MOSS

Here is another trick to add custom validations or script while submiting a listitem in NewForm.aspx or EditForm.aspx.

When you click on OK or Submit in NewForm.aspx or EditForm.aspx, it will execute following script to submit the data into SharePoint DB.

if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
theForm.submit();


So, if you want to add custom validation or script before submiting, then add a Content Editor WebPart in the same page with following script.

< language="javascript">
var submitButton = document.getElementById("<>")
submitButton.onclick = updateButton;

function updateButton()
{
//
// Add custom code to validate a page or any other functionality
// which needs to be performed before submiting a page
//

if (!PreSaveItem()) return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
theForm.submit();
}
< / script>


in the sameway, you can add confirmation message for cancel button

function updateCancelButton()
{
var conf = confirm("Are you sure you want to cancel?");
if (conf)
{
STSNavigate('\u002f');return false;
WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(<>, '', true, '', '', false, true))
}
}

I hope this helps. Happy coding...

SharePoint Customization

Here is the procedure to customize Multiline text box and Multi select box in MOSS 2007.

  • To increase the size of Multiline textbox, modify width in .ms-long class.

If you want only modify in one page then add a content editor Webpart in the page and place the following code inside.

This will change only in that particular page. If you want this change to apply for the entire portal then modify Core.css file.

  • To increase the height and width of Multiple selection list box. Then you have to modify “SPHtmlSelect_Adjust” function in

“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\GroupedItemPicker.js”.

function SPHtmlSelect_Adjust(oSelect)

{

var oDiv=oSelect.parentNode;

if (oDiv.tagName !="DIV")

return;

if (oSelect.options.length <>

oSelect.size=20;

else

oSelect.size=oSelect.options.length;

var widthDiv=oDiv.clientWidth;

var widthSel=oSelect.offsetWidth;

if (widthSel <>

{

oSelect.style.width=widthDiv+"px";

}

if (oSelect.selectedIndex <>

return;

var pos=Math.round((oSelect.selectedIndex * oDiv.scrollHeight / oSelect.size));

if (pos <>

{

oDiv.scrollTop=pos;

}

else if (pos > Math.round(oDiv.scrollTop+oDiv.clientHeight - (oDiv.scrollHeight / oSelect.size)))

{

oDiv.scrollTop=Math.round(pos - oDiv.clientHeight+(oDiv.scrollHeight / oSelect.size));

}

}