Wednesday, January 4, 2012

SharePoint Variations – The complete Guide

Today I will start a new article series, which will discuss all aspects of the SharePoint Variations feature.
The article series will provide insights into the underlying architecture and will also provide details about customization.
But before we can start with the internals we first have to start with the basics.

Link:
http://blogs.technet.com/b/stefan_gossner/archive/2011/11/14/sharepoint-variations-the-complete-guide-part-1-the-basics.aspx

Thursday, December 29, 2011

SharePoint 2010 Client object Model

Using the SharePoint Foundation 2010 Managed Client Object Model:

http://msdn.microsoft.com/en-us/library/ee857094(office.14).aspx

Reading Data from External List using the SharePoint 2010 Client Object model:

http://blogs.msdn.com/b/steve_fox/archive/2010/01/19/reading-data-from-external-list-using-the-sharepoint-2010-client-object-model.aspx


Using the SharePoint Foundation 2010 Managed Client Object Model with the Open XML SDK 2.0:

http://msdn.microsoft.com/en-us/library/ee956524(office.14).aspx



Working with the ECMAScript Client Object Model (JSOM) in SharePoint 2010–Part 1 (Nikhil Sachdeva):

http://blogs.msdn.com/b/sharepointdev/archive/2011/07/13/working-with-the-ecmascript-client-object-model-jsom-in-sharepoint-2010-part-1-nikhil-sachdeva.aspx

Converting Word Documents to PDF Using SharePoint Server 2010 and Word Automation Services

Introducing Word Automation Services:
http://blogs.office.com/b/microsoft-word/archive/2009/10/26/introducing-word-automation-services.aspx

Over the last couple of months, we've posted about many of the exciting new features of Word 2010 – Co-authoring, the new Find experience, and the Word Web App. This week, at SharePoint Conference 2009, we announced one more (and one that I'm especially excited about): Word Automation Services.




In the post on framing the Word 2010 release, one of the pillars described is "Word Power in New Contexts". Word Automation Services is a big part of that pillar, and represents our desire to ensure that the power and functionality of Word is available beyond the desktop; in this case, by enabling developers to harness the capabilities of Word on the server as part of SharePoint 2010.



Word Automation Services

Have you ever wanted to convert .docx files into PDF? We've heard from many customers trying to perform server side conversions of Open XML files (.docx) into fixed formats (PDF and XPS) using the Word desktop application, and that's what motivated us to create Word Automation Services.



As a component of SharePoint 2010, Word Automation Services allows you to perform file operations on the server that previously required automating desktop Word:



•Converting between document formats (e.g. DOC to DOCX)

•Converting to fixed formats (e.g. PDF or XPS)

•Updating fields

•Importing "alternate format chunks"

•Etc.

If you've done any automation of Word, you're probably familiar with the challenges of doing so – challenges well documented by this Knowledge Base article: http://support.microsoft.com/kb/257757. With Word Automation Services, those challenges are a thing of the past:



•Reliability – The service was built from the ground up to work in a server environment, which means that you no longer have to worry about issues like dialog boxes that bring the process to a halt, expecting a user to provide input; creating interactive user accounts under which to run the application to avoid running into permissions issues, etc.

•Speed – The service is optimized to perform server-side file operations, and in doing so provides performance significantly better than existing solutions.

•Scalability – The service can take advantage of the processing power available on typical server hardware (multiple processors, additional memory). For example, although a single instance of WINWORD.EXE can only utilize a single core of processing power, with Word Automation Services, you can specify the number of simultaneous conversions (and the # of processing cores) to use based on the available hardware.

And you still have a solution that has 100% fidelity with respect to the Word desktop application – documents are paginated the same way on the server as they are on the client, ensuring that what you see on the client is what you get from the server.



In future posts, I'll spend some time digging into exactly how the service works, as well as each of these benefits of the service in further detail.




Summary: Learn to programmatically convert Word documents to PDF format on the server by using Word Automation Services with SharePoint Server 2010.


Sample Code:
using System;


using System.Security.Permissions;

using Microsoft.SharePoint;

using Microsoft.SharePoint.Security;

using Microsoft.SharePoint.Utilities;

using Microsoft.SharePoint.Workflow;



using Microsoft.Office.Word.Server.Conversions;



namespace ConvertWordToPDF.ConvertWordToPDFEventReceiver

{

///

/// List Item Events

///


public class ConvertWordToPDFEventReceiver : SPItemEventReceiver

{

///

/// An item was added.

///


public override void ItemAdded(SPItemEventProperties properties)

{

base.ItemAdded(properties);



// Verify the document added is a Word document

// before starting the conversion.

if (properties.ListItem.Name.Contains(".docx")



properties.ListItem.Name.Contains(".doc"))

{

//Variables used by the sample code.

ConversionJobSettings jobSettings;

ConversionJob pdfConversion;

string wordFile;

string pdfFile;



// Initialize the conversion settings.

jobSettings = new ConversionJobSettings();

jobSettings.OutputFormat = SaveFormat.PDF;



// Create the conversion job using the settings.

pdfConversion =

new ConversionJob("Word Automation Services", jobSettings);



// Set the credentials to use when running the conversion job.

pdfConversion.UserToken = properties.Web.CurrentUser.UserToken;



// Set the file names to use for the source Word document

// and the destination PDF document.

wordFile = properties.WebUrl + "/" + properties.ListItem.Url;

if (properties.ListItem.Name.Contains(".docx"))

{

pdfFile = wordFile.Replace(".docx", ".pdf");

}

else

{

pdfFile = wordFile.Replace(".doc", ".pdf");

}



// Add the file conversion to the conversion job.

pdfConversion.AddFile(wordFile, pdfFile);



// Add the conversion job to the Word Automation Services

// conversion job queue. The conversion does not occur

// immediately but is processed during the next run of

// the document conversion job.

pdfConversion.Start();



}

}

}

}

Important Links:
http://msdn.microsoft.com/en-us/library/ff181518.aspx


http://msdn.microsoft.com/en-us/library/ff742315.aspx

Word Automation Services:

http://msdn.microsoft.com/en-us/library/gg703645.aspx

Sample Code download:

http://code.msdn.microsoft.com/SharePoint-2010-Converting-7904ca12

http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/661ab377-6f6a-40f0-8c83-8a0300a9a470

http://msdn.microsoft.com/en-us/library/gg703645.aspx

http://blogs.msdn.com/b/ericwhite/archive/2010/03/17/word-automation-services-determining-which-documents-failed-to-convert-using-c.aspx


Using Word Automation Services in a Workflow custom activity for SP Designer Workflows:

http://blogs.msdn.com/b/chandru/archive/2010/09/04/using-word-automation-services-as-a-workflow-custom-activity-in-sp-designer.aspx


What is the Difference between ‘Word Automation’ and ‘Word Automation Services’?:

http://blogs.msdn.com/b/ericwhite/archive/2010/12/07/what-is-the-difference-between-word-automation-and-word-automation-services.aspx




Customization of Sharepoint Barcode

1.Go to  Inforamtion Management Policy Settings,Enable Define Policy.
    Enable barcode feature.
2.When Customized for your Requirements throught Coding.


 using (siteCollection)


{

using (site)

{
SPList list = site.Lists["MyList"];

SPListItem item = list.AddItem();

item["Title"] = "test2";

// this file just ensure item.File non-null. You could set it to arbitrary value.

SPFile file = site.GetFile(http://wjc:1130/SiteAssets/CEWP.aspx);

FieldInfo itemFileInfo = item.GetType().GetField("m_file", BindingFlags.NonPublic
BindingFlags.Instance);
itemFileInfo.SetValue(item, file);
FieldInfo itemFileInitInfo = item.GetType().GetField("m_fileInit", BindingFlags.NonPublic
BindingFlags.Instance);
itemFileInitInfo.SetValue(item,true);
//item.Update();

System.Drawing.Image img;

string id = "0123456789";

Barcode.ProvisionBarcodeWithValue(item, true, ref id, out img);

Barcode.SetBarcodePreview(item);
item.Update();
Console.Read();
}

}



Links:
http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010programming/thread/b4fab7a5-d21d-4a40-9cec-e9e145802958

http://www.sharepointsecurity.com/sharepoint/sharepoint-development/programmatically-changing-a-sharepoint-barcode/

http://social.technet.microsoft.com/Forums/is/sharepoint2010setup/thread/f232e9d1-09bb-423a-9780-b69d16d51698

http://blogs.msdn.com/b/recman

SharePoint Server 2007 and Records Management

This blog series will address the role that SharePoint can play in Records Management within an organization and the abilities and functionality that can be leveraged from the platform. The blog consists of four posts:




1. Introduction to Records Management, and Definition of Terms (this post)


2. Records Management using Standard SharePoint Features



3. Using the DOD 5015.2 Records Management Resource Kit



4. Commonly Requested Enhancements and Features

Link:
http://blogs.msdn.com/b/uksharepoint/archive/2009/09/29/sharepoint-and-records-management-part-2-of-4.aspx

AutoRemainder: Using Sharepoint Designer and Information management policy.

Task:
 Remainder Email goes Incase if person  no action is taken in 48 hours.

Solution: Using Sharepoint Designer and Information management policy.

 Check this Link:

 http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?List=676af157-7d96-4e15-a987-54b8a3e4d948&ID=72