This blog is moved to
http://amalhashim.wordpress.com

Tuesday, June 28, 2011

Service Pack 1 for SharePoint 2010 Products is Now Available for Download

Service Pack 1 for SharePoint 2010 Products is Now Available for Download

Service Pack 1 includes stability, performance, and security enhancements that are a direct result of your feedback.

It is strongly recommended to install the June 2011 Cumulative Update immediately after the installation of Service Pack 1. The June Cumulative Update includes several important security and bug fixes that are not included Service Pack 1.

Prior to installing Service Pack 1 you should carefully read the known issues and release notes at

http://support.microsoft.com/kb/2532126

Service Pack 1 for SharePoint 2010 Products is Now Available for Download

by altsharepointblog@live.com on  6/28/2011 7:02 AM

Category:  SharePoint 2010

Service Pack 1 for SharePoint 2010 Products is Now Available for Download

Service Pack 1 includes stability, performance, and security enhancements that are a direct result of your feedback.

IMPORTANT NOTE

It is strongly recommended to install the June 2011 Cumulative Update immediately after the installation of Service Pack 1. The June Cumulative Update includes several important security and bug fixes that are not included Service Pack 1.

Installing Service Pack 1

Prior to installing Service Pack 1 you should carefully read the known issues and release notes at

http://support.microsoft.com/kb/2532126

Service Pack 1 includes all fixes released through April 2011 so it can be installed directly to RTM builds of SharePoint 2010 Products, or any prior Cumulative Update.

Install the service packs in the following order on every server in the farm.

1. Service Pack 1 for SharePoint Foundation 2010

2. Service Pack 1 for SharePoint Foundation 2010 Language Pack (if applicable)

3. Service Pack 1 for SharePoint Server 2010

4. Service Pack 1 for SharePoint Server 2010 Language Pack (if applicable)

The SharePoint 2010 Products Configuration Wizard or "psconfig –cmd upgrade –inplace b2b -wait” should be run once on every server in the farm following the final update installed.

The version of content databases will be 14.0.6029.1000 after successfully installation. For more in-depth guidance for the update process, we recommend reviewing the following articles. These articles provide a correct way to deploy updates and identify known issues (and resolutions).

Prepare to deploy a software update for SharePoint Foundation 2010

Install a software update for SharePoint Foundation 2010

Prepare to deploy a software update for SharePoint Server 2010

Install a software update for SharePoint Server 2010

Frequently Asked Questions

Q: Can I install Service Pack 1 on RTM builds of SharePoint 2010 Products?

A: Yes, Service Pack 1 can be installed directly on RTM builds; however, we suggest you install Service Pack 1 then apply the June 2011 Cumulative Update.

Q: Do I need to run psconfig after the install of every package?

A: No, apply all of the available packages then run psconfig - the database will only be updated once, to the newest version.

Q: Do I need to run psconfig on every machine in the farm?

A: Yes. Although database is already updated, the binaries on each server need to be set and permissioned using psconfig.

Q: Will there be a slipstream build including Service Pack 1 available for download?

A: At this time a slipstream build including Service Pack 1 is not available.

Wednesday, May 18, 2011

Serialize Multiobject ArrayList to XML

This is a code snippet which shows how to Serialize an ArrayList to XML. ArrayList contains objects of different types.

using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;

namespace ConsoleApplication1
{
class Program
{

static void Main(string[] args)
{
AListWrapper wrapper = new AListWrapper();

XmlSerializer mySerializer = new XmlSerializer(typeof(AListWrapper));

StreamWriter myWriter = new StreamWriter("c:\\myFileName.xml");

mySerializer.Serialize(myWriter, wrapper);
myWriter.Close();
}
}

public class Animal
{
public string Type { get; set; }
public int Age { get; set; }
}

public class Employee
{
public string Name { get; set; }
public double Salary { get; set; }
public string Address { get; set; }
}

[XmlRoot("ArrayList")]
public class AListWrapper
{
[XmlElement(Type = typeof(Employee)),
XmlElement(Type = typeof(Animal))]
public ArrayList list = new ArrayList();

public AListWrapper()
{
Animal animal = new Animal()
{
Age = 1,
Type = "Dog"
};

Employee emp = new Employee()
{
Address = "Address",
Name = "SomeName",
Salary = 2000.50
};

list.Add(animal);
list.Add(emp);
}
}
}

Wednesday, May 4, 2011

jQuery 1.6 Released

Sams Teach Yourself jQuery in 24 Hours
jQuery 1.6 is now available for download!

jQuery CDN:
Microsoft Ajax CDN:
You can read more about this on the following link: http://blog.jquery.com/2011/05/03/jquery-16-released/

Monday, May 2, 2011

SharePoint 2010 Word Automation Services

Professional SharePoint 2010 AdministrationaltBeginning SharePoint 2010 Development (Wrox Beginning Guides)Microsoft SharePoint 2010: Building Solutions for SharePoint 2010 (Books for Professionals by Professionals)altMicrosoft® SharePoint® 2010 Administrator's Companionalt

In SharePoint 2010, you can add "Word Automation Services" from Central Admin as shown below

image

Once the service is in place, we can easily convert Word documents to PDF as shown in below snippet

private voidConvertDocFileToPDF(SPFile filex)
{           
    ConversionJobSettings settings = newConversionJobSettings();
    settings.OutputFormat = SaveFormat.PDF;
    ConversionJob job = newConversionJob(ConfigurationHelper.Instance.DocumentConversionService, settings);   
    job.UserToken = SPUserToken.SystemAccount;
    stringpdfFile = filex.Url.Replace("docx", "pdf");
    job.AddFile("http://<your site URL>/"+ filex.Url, "http://<your site URL>/"+ pdfFile);
    job.Start();
}

Ensure to add reference to “Microsoft.Office.Word.Server” present under 14 hive “ISAPI” folder.

To test this, run “Word Automation Services Timer Job”

DataTable to GenericList | C# and LINQ

Programming Microsoft® LINQ in Microsoft .NET Framework 4 
using System;
using System.Data;

namespace ConsoleApplication1
{
class Program
{

static void Main(string[] args)
{
DataTable table = new DataTable
{
Columns = {
{"Id", typeof(int)},
{"Name", typeof(string)}
}
};

table.Rows.Add(1, "Amal");
table.Rows.Add(1, "Fousiya");
table.Rows.Add(1, "Munna");
table.Rows.Add(1, "Hussain");         

var listOfEmployees = from row in table.AsEnumerable()
select new Employee
{
Id = row.Field<int>("Id"),
Name = row.Field<String>("Name")
};

foreach (Employee emp in listOfEmployees)
{
Console.WriteLine("{0}   {1}", emp.Id, emp.Name);
}
}
}

class Employee
{
public int Id { get; set; }
public String Name { get; set; }
}
}

Friday, April 1, 2011

MVP 2011 - For the second time

Hi all,

Today I got awarded as MVP for the second time in a row. See the mail i got...feeling really happy.

From: support@mvpaward.com
To: amal.hashim@hotmail.com
CC: abhishek@microsoft.com
Date: Fri, 1 Apr 2011 09:12:39 -0500
Subject: Congratulations 2011 Microsoft MVP!



Dear Amal Hashim,

Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in Visual C# technical communities during the past year.

Also in this email:

  • About your MVP Award Gift
  • How to access www.mvpaward.com to begin taking advantage of your award benefits
  • Your MVP Identification Number
  • MVP Award Program Code of Conduct
The Microsoft MVP Award provides us the unique opportunity to celebrate and honor your significant contributions and say "Thank you for your technical leadership."

Toby Richards
General Manager
Community & Online Support

Monday, January 24, 2011

Color Coding SharePoint List – With or Without Grouping

Using jQuery we can easily color code lists in SharePoint 2007.

Try using the following script

<script type="text/javascript" src="/_layouts/jquery-1.4.4/jquery-1.4.4.min.js"></script>

<style type="text/css">
.MyStyle
{
font-size: 11px;
background-color: red;
}
</style>
<script type="text/javascript">

$(document).ready(function(){

$(".ms-vb2:contains('Completed')").each(function(){
$(this).addClass(MyStyle);
});
});

</script>


Problem with this approach is, it won’t work in views with grouping. The problem is, on grouping, collapsed group data is not rendered on page load. To tackle this we need to tweak scripts in INIT.js, but directly modifying is not a good practice. To overcome this we can override the method which is rendering the data as shown in the below script block.



<style type="text/css">
.MyStyle
{
font-size: 11px;
background-color: red;
}
</style>

<script type="text/javascript" src="/_layouts/jquery-1.4.4/jquery-1.4.4.min.js"></script>

<script type="text/javascript">

//wait until all of the SharePoint stuff is loaded...
_spBodyOnLoadFunctionNames.push("CustomExpGroupByFix");

function CustomExpGroupByFix()
{
//Replace the function in INIT.JS with our custom function
window.ExpGroupReceiveData=function(x,y){ExpGroupReceiveDataC(x,y)}

}

//This is the exact replica of INIT.JS "ExpGroupReceiveData", we have added color coding code at the end
function ExpGroupReceiveDataC(htmlToRender, groupName)
{
var ctxId="ctx"+groupName.substring(0, groupName.indexOf("-"));
var indexBeginCTXName=htmlToRender.indexOf("CTXName=\"");
if (indexBeginCTXName !=-1)
{
if (ctxId !="ctx1")
{
htmlToRender=htmlToRender.replace(/ CTXName=\"ctx1\" /g, " CTXName=\""+ctxId+"\" ");
}
}
var needOuterWrap=false;
if (htmlToRender.length < 4)
{
needOuterWrap=true;
}
else if (htmlToRender.substring(0,3) !="<tr")
{
needOuterWrap=true;
}
if (needOuterWrap)
{
htmlToRender="<TR><TD>"+htmlToRender+"</TD></TR>";
}
ExpGroupRenderData(htmlToRender, groupName, "true");
g_ExpGroupInProgress=false;
if (g_ExpGroupQueue.length > 0)
{
ExpGroupFetchData(g_ExpGroupQueue.shift());
}

//Color coding the cells
$(".ms-vb2:contains('Completed')").each(function(){
$(this).addClass(MyStyle);
});
}
</script>


To use this script, edit the page –> add a content editor webpart.