Wednesday, February 24, 2010

What's New in Infopath 2010

Link Referred: http://blogs.msdn.com/infopath/archive/2009/07/15/what-s-new-in-infopath-2010.aspx Microsoft InfoPath 2010 makes it easier than ever to design electronic forms. InfoPath now includes the Office Fluent UI and allows the creation of powerful, interactive forms, without having to write any code. With a few clicks, Office users can customize SharePoint list forms, add custom layouts and rules to validate the data, and take them offline in SharePoint Workspace. IT professionals can create custom forms for document workflows and Office Business Applications that include managed code, digital signatures and that connect to line of business data. In InfoPath 2010, we’ve made some big investments to make it much easier to build rich forms-based applications on top of the SharePoint Server 2010 platform. Quickly Design Forms with Easy-to-Use Tools New features to help you quickly and easily create forms include our new Fluent UI, pre-built layout sections, out-of-the-box rules, improved rules management, and varied styles. The New tab in the Designer Backstage presents you with the available form templates that you can choose from. Most templates start you off with a default layout table. Stay tuned for more details on our new and improved form design features! Layout your Forms Using Pre-built Page and Section Layouts Laying out your form and making it look more attractive is now easier than ever. Insert one of our pre-built page layouts to give your form structure. Then, insert some section layouts into the page layout to start building your form. Page and Section Layouts in InfoPath Designer:
New and Improved Controls We’ve added some new controls and narrowed the feature gap between client and browser forms, ensuring a more consistent form filling experience for all our users.
New controls in InfoPath 2010 include: Picture buttons – Instead of the default gray button, use any image as a button in your form. Hyperlink capabilities –Allow users to insert their own hyperlinks when filling out forms. Date and time picker – Allow users to insert dates and times in their forms Person/Group pickers – Updated! This is now a first class control and is included by default in the Controls gallery. Signature Line (Editor Only) – Allow users to digitally sign a form Controls and functionality that are now supported in browser forms include: Bulleted, numbered, and plain lists, multiple selection list boxes, Combo boxes, Choice group and sections, and Filtering functionality. Add Rules to your Forms With our new out-of-the-box rules (or quick rules) and improved rules management UI, you can easily add rules to validate data, format your form, or perform other actions with just a couple of clicks, and without any code. Quick Rules in InfoPath Designer: Publish Forms Quickly Our new “quick” publish functionality allows you to publish forms in a single click (no more clicking through the Publishing Wizard every time you want to make an update to your forms!) Create Forms for SharePoint Lists Using InfoPath, you can now extend and enhance the forms used for creating, editing and viewing items in a SharePoint list. In a browser, simply navigate to a SharePoint list, and on the SharePoint Ribbon under List Tools, choose the Customize Form option. This will automatically generate a form which looks very similar to the default out-of-the-box SharePoint list form. You can then customize and enhance this form by modifying the layout, creating additional views or pages, and adding rules to validate your data, show or hide sections of the form or set a fields value (to name just a few of the options). Example of Customized SharePoint List Form: Stay tuned for more details on SharePoint List Customization! We recommend using a form associated with a SharePoint list when possible. This provides the most straightforward design and form management experience. However, there are more complex scenarios where using a form associated with a form library is preferred e.g. if your form has a complex schema or if you need to add code to your form. Create SharePoint Applications With InfoPath 2010, SharePoint Server 2010, and SharePoint Designer 2010, you can easily create powerful team, departmental or enterprise applications on top of SharePoint Server. Form-based applications: InfoPath forms can be integrated with components such as workflow, reporting, and custom Web pages to create rich form-based applications. Document Workflows: InfoPath can be used to design custom workflow initiation and task forms that drive document management processes. Business Connectivity Services: Integrating with BCS, it is straightforward to design InfoPath forms that create, read, update, and delete business data from a back-end system. Stay tuned for more details on creating SharePoint applications! Create Mashups using the InfoPath Form Web Part Now, without writing a single line of code, you can host your InfoPath browser forms in Web pages by simply adding the InfoPath Form Web Part to a Web Part page. You can also connect it to other Web Parts on the page to send or receive data. Stay tuned for more details on the InfoPath Form Web Part! Build Forms with Code Using Visual Studio Tools for Applications, you can add managed code to your forms. Stay tuned for more details on programming with InfoPath! InfoPath Editor The InfoPath 2010 Editor Fluent user interface provides a much improved, simpler user experience for filling out forms. Form opened in InfoPath 2010 Editor: SharePoint Workspace InfoPath 2010 is the forms technology used by SharePoint Workspace 2010 for creating and filling out forms. InfoPath Forms Services Administration and Management We have invested in many improvements to make it easier to manage your InfoPath Forms Services as a component of Microsoft SharePoint Server 2010.

Tuesday, February 23, 2010

Batch Files to Retract, Deploy WSPs

All-Retr-Depl-Sol @Echo on @Echo Installing all solutions @Echo. @Echo. for %%i in (*.wsp) do call Retr-Depl-Sol %%i for %%i in (*.wsp) do call Feature-Deac-Act %%~ni Retr-Depl-Sol @Echo on @Echo Retracting Solution %1 stsadm -o retractsolution -name %1 -immediate stsadm -o execadmsvcjobs @Echo Deleting Solution %1 stsadm -o deletesolution -name %1 @Echo Adding Solution %1 stsadm -o addsolution -filename %1 @Echo Deploying Solution %1 stsadm -o deploysolution -name %1 -immediate -allowgac -force stsadm -o execadmsvcjobs stsadm -o execadmsvcjobs Feature-Deac-Act @echo On stsadm -o deactivatefeature -filename %1\feature.xml -url http://Server/ -force stsadm -o activatefeature -filename %1\feature.xml -url http://Server/ -force iisreset popd

Monday, February 22, 2010

Count Forms in each List in a Document Library

Code Writes output a Directory with a file name in C:\\ public string ListCount() { string logFileName = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); logFileName = logFileName.Replace("/", "-"); logFileName = logFileName.Replace(":", "-"); logFileName = "C:\\Document Library Items Count - " + logFileName + ".csv"; SPSite mySite = new SPSite(SPContext.Current.Site.Url); SPWeb myWeb = mySite.OpenWeb(); StringBuilder tempTitle = new StringBuilder(""); StringBuilder tempItemCount = new StringBuilder(""); foreach (SPList list in myWeb.Lists) { string BTemplate = list.BaseTemplate.ToString(); if (list.BaseType == SPBaseType.DocumentLibrary && BTemplate == "XMLForm") { int FolderCount = list.Folders.Count; tempTitle.Append(list.Title + ","); tempTitle.Append("\t"); tempTitle.Append((list.ItemCount - FolderCount)); tempTitle.AppendLine(); if (FolderCount != 0) { list.RootFolder.SubFolders.Count.ToString(); foreach (SPListItem myList in list.Folders) { string FolderName = myList.DisplayName.ToUpper(); tempTitle.Append(" ( Folder: " + FolderName + " in " + myList.Folder.ParentFolder.Name + " )"); SPFolder folder = myWeb.GetFolder(myList.DisplayName); string folderItemsCount = myList.Folder.Files.Count.ToString(); tempTitle.Append(" Number of Forms : " + folderItemsCount); tempTitle.AppendLine(); } } } } StreamWriter logWriter = File.CreateText(logFileName); logWriter.WriteLine(""); logWriter.WriteLine("DOCUMENT LIBRARY NAME" + "," + "NUMBER OF FORMS"); logWriter.WriteLine(""); logWriter.WriteLine(tempTitle); logWriter.Close(); return (tempTitle.ToString()); }

Create New Sharepoint Web Service

The Post referred http://msdn.microsoft.com/en-us/library/ms464040.aspx (1)Basic Steps for Creating a Web Service Create an ASP.NET Web service in Microsoft Visual Studio 2005. Create a class library within the Web service that defines the programming logic for the Web service. Generate and edit a static discovery file and a Web Services Description Language (WSDL) file. Deploy the Web service files to the _vti_bin directory. Create a client application to consume the Web service.

(2)To create an ASP.NET Web service

a)In Visual Studio, click File, point to New, and then select Web Site. b)In the Templates box of the New Web Site dialog box, select ASP.NET Web Service, select File System in the Location box, select a programming language and location for the project, and then click OK.

C) Within the new Web service solution, create a separate class library project to contain the Web service logic.

[ To create the project, click File, point to New, and then select Project.] In the New Project dialog box, select a language in the Project types box, select Class Library in the Templates box, provide a name and location for the project, select Add to Solution in the Solution box, and then click OK.

D)Add a reference to the System.Web.Services namespace in the class library project. And also Microsoft.SharePoint

E)Replace the default class file in the class library project with the default service class file that Visual Studio provides in the App_Code folder of the Web service. [To replace the class file with the service class file ] In Solution Explorer, drag Service.cs or Service.vb to the top node in the class library project. Delete the Class1.cs or Class1.vb file, and also delete the Service.cs or Service.vb file that remains in the App_Code folder.

F)Create a strong name for the class library: In Solution Explorer, right-click the class library project, and then click Properties. In the Properties dialog box, click Signing, select Sign the assembly, and then select in the Choose a strong name key file list. In the Create Strong Name Key dialog box, provide a file name for the key, clear the Protect my key file with a password check box, and then click OK.

G) To build only the class library project, right-click the project in Solution Explorer, and then click Build.

H) To add your assembly to the global assembly cache (GAC), you can either drag the assembly into the % windows%\assembly directory using 2 instances of Windows Explorer, or use the command line utility gacutil.exe that is installed with the Microsoft .NET Framework SDK 2.0. To use gacutil.exe to copy the class library DLL into the GAC To open the Visual Studio command prompt, click Start, point to All Programs, point to Microsoft Visual Studio 2005, point to Visual Studio Tools, and click Visual Studio 2005 Command Prompt. At the command prompt type a command in the following form, and press ENTER: gacutil.exe -if "".

I) Now you are ready to modify the assembly information in the default Service.asmx file of the Web service with information for the DLL from the GAC. To get information from the GAC, open the %windows% \assembly directory in Windows Explorer, right-click your assembly, and click Properties.

J) To open Service.asmx in Solution Explorer, right-click the file and click Open. Remove the CodeBehind attribute from the page directive in Service.asmx, and modify the contents of the Class attribute so that the directive matches the following format, where the assembly name "NewAssembly" and the public key token are values specified in the Properties dialog box that you opened in step 10: <%@ WebService Language="C#" Class="Service,NewAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8f2dca3c0f2d0131" %>

K)Rename your .asmx file appropriately, and then save your changes.

3)Generate Static discovery and WSDL files.

In Windows Explorer, copy the .asmx file of your Web service to \\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS.

4)Reset IIS for the DLLs in assembly to take effect.

5)Type in http://Server/_layouts/Service.asmx for the Service and its methods in it.