What Tools Are Available?

In this next section, I will provide an overview of the various development tools that can be used to create OBA solutions, as well as simply customize and develop SharePoint solutions. In reading previous chapters, you may have noticed that this book is heavily focused on showcasing the power of Microsoft Visual Studio 2008 and its many new features for developing Office solutions for both Microsoft Office 2007 and 2003. It is important to mention from a developer standpoint that when developing solutions on SharePoint you will need to have several tools in your arsenal, and all of them offer different approaches and capabilities. In the next several sections, I will dig into some of the details.

Visual Studio 2008

The latest release of Microsoft Visual Studio 2008 has many new capabilities added for developing Office solutions. Chapter 2 discussed the use of the Visual Ribbon Designer, building custom task panes, and creating various Office application add-ins, all key elements of extending the client capabilities of Office. Visual Studio 2008 also provides two new project types for creating Sequential and State Machine Workflows. Figure 6-7 illustrates the different project types provided by Visual Studio 2008, of which you can see the two new SharePoint 2007 workflow types. It is important to mention that these new workflow project types require Microsoft Office SharePoint Server 2007.

Two SharePoint 2007 template projects for workflow, Sequential, and State Machine

Figure 6-7. Two SharePoint 2007 template projects for workflow, Sequential, and State Machine

The next two sections describe the different capabilities that these two workflow types provide to OBAs. It is also important to mention that the Sequential and State Machine Workflows are included with Windows SharePoint Services version 3.0 out of the box.

Sequential Workflow

A Sequential Workflow represents a workflow as a procession of steps that execute in order until the last activity completes. A good example of this would be routing around an expense report for approval. However, Sequential Workflows are not purely sequential in their execution. Because they can receive external events, and include parallel logic flows, the exact order of activity execution can vary somewhat. Figure 6-8 illustrates the design time environment provided by Visual Studio for setting up a Sequential Workflow.

Setting up a Sequential Workflow with Visual Studio 2008

Figure 6-8. Setting up a Sequential Workflow with Visual Studio 2008

State Machine Workflow

A State Machine Workflow represents a set of states, transitions, and actions. One state is denoted as the start state, and then, based on an event, a transition can be made to another state. The State Machine can have a final state that determines the end of the workflow. Figure 6-9 illustrates a State Machine Workflow.

These new workflow capabilities added to Visual Studio 2008 allow for the development of customized workflows that you can build to address whatever business requirements you may have when developing OBAs and integrating with various LOBs. But don’t think that you have to develop all your workflows custom. Both WSS version 3.0 and MOSS 2007 come with out-of-the-box workflows that you can immediately leverage in building OBAs.

MOSS 2007 Out-of-the-Box Workflows

The following workflows are provided after installation of MOSS 2007. Each of these workflows can be associated with a document library or list. It is also important to mention that the State Machine and Sequential Workflows are included in the installation of Windows SharePoint Services version 3.0.

Setting up a State Machine Workflow with Visual Studio 2008

Figure 6-9. Setting up a State Machine Workflow with Visual Studio 2008

Approval Workflow

The Approval Workflow is one of the most important and most used workflows that come with MOSS 2007. The Approval Workflow is primarily used for routing documents around to colleagues; these could be simple or complex documents ranging from a product data sheet to an expense report. The Approval Workflow provides the ability to handle either serial or parallel processing. We can use the two examples of the data sheet and expense report to explain this further; in the scenario of routing the data sheet around, this could go to several people in parallel, therefore not causing a potential bottleneck if a reviewer is out of the office. In the case of the expense report, this would most likely be a serial approval, requiring each level of management in an organization to approve before proceeding to the next. Another great example of using the Approval Workflow is with the Web content management capabilities of MOSS 2007. Again referring back to the product data sheet example, once the document is approved you can automatically publish this content to your Web site with major and minor versioning.

Collect Feedback Workflow

The Collect Feedback Workflow is all about collaboration. Given the worldwide distribution of teams in today’s business world, an effective way to collect others’ feedback is needed. The Collect Feedback Workflow provides an information worker with the ability to route around a document to a set of people to request their individual feedback. As the workflow progresses from person to person, the feedback is collected until it is complete. After completion, the collective feedback is then available to the feedback requestor for review. An example of how you could use this workflow within an OBA is to make it part of an overall business process.

Collect Signatures Workflow

The Collect Signatures Workflow is provided to do exactly as it states—collect digital signatures. Unlike the other workflows, the Collect Signatures can be started only from one of the Microsoft Office 2007 client programs, such as Microsoft Office Word 2007, Microsoft Office Excel 2007, or Microsoft Office PowerPoint 2007. In order to start this workflow, it must be saved to a document library that has the workflow associated; next you click on the Microsoft Office Button and choose the Workflows option to initiate. OBA scenarios in which you would use the Collect Signatures Workflow could involve capturing digital signatures for releasing documentation for products, vacation requests, personnel reviews, financial statements, business and sales contracts, and medical documents, to name a few.

Disposition Approval Workflow

The Disposition Approval Workflow is best used to manage the expiration and retention of documents within a document library. This workflow provides a process flow that allows information workers to decide whether or not to retain or delete documents. This workflow is well suited for use with the MOSS 2007 Records Center. Now you may be asking, "Why would I use this workflow and the Records Center in an OBA solution?" OBAs are all about integrating data into the Microsoft Office 2007 clients and server products in order to produce additional content that is of some business value to an organization. The combination of the workflow and Records Center is the vault to store business contracts, legal documents, and the like to ensure compliance with the many regulations all businesses are bound by in today’s business world.

You’ll find a more in-depth discussion of workflow in Chapter 7.

Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions

You may be wondering why we are talking about Visual Studio 2005 when this book is focused on Visual Studio 2008. The simple answer to that question is that, when developing SharePoint solutions, you currently need an arsenal of tools, not just one. It’s unfortunate, and we have received a lot of feedback on the topic, so understand that we are listening and the future looks very promising for SharePoint development; by the time you start reading this book, the next version of Extensions for Windows SharePoint Services version 3.0 may be available for Visual Studio 2008, but until that new version is released we need to use the tools that are available today. With that said, let’s discuss one of the most powerful tools, Visual Studio 2005 extensions for Windows SharePoint Server (VSeWSS) version 3.0 for developing SharePoint components, especially Web parts, team and blank site definitions, and list definitions. Figure 6-10 illustrates the SharePoint project types.

Project templates for SharePoint provided by VSeWSS

Figure 6-10. Project templates for SharePoint provided by VSeWSS

Web Parts Template

With VSeWSS the Web part template provides you, the developer, the ability to generate a basic Web part that you can immediately begin customizing with your own custom code and user interface design. Figure 6-11 illustrates the project that is generated after choosing the Web part project template, and Figure 6-12 shows the actual project running inside of MOSS.

Using the stubbed-out Web part project and simply changing the output text, and then hitting F5, you end up with Figure 6-12—all within just a few moments after installing VSeWSS on either your WSS version 3.0 or MOSS 2007 developer machine. When developing OBAs that utilize SharePoint (WSS version 3.0 or MOSS 2007), Web parts will be the predominant method for you to build custom integration with a LOB system. Web parts will allow you to present to information workers a custom user experience that provides integration with an LOB without having that information worker actually need to use the LOB user interface.

SharePoint Solution Generator

The SharePoint Solution Generator (SSG) is a handy utility that allows you to take a site "instance" that has been customized with Microsoft Office SharePoint Designer 2007 or with the browser, and convert it into a site definition, which we discussed earlier. The extra value added is that after the conversion, the developer can further edit that definition in Visual Studio 2005. Figure 6-13, Figure 6-14, Figure 6-15, and Figure 6-16 illustrate the SSG wizard, and Figure 6-17 illustrates the converted site definition opened in Visual Studio 2005 for further customization.

The basic Web part project from VSeWSS

Figure 6-11. The basic Web part project from VSeWSS

Output from the project in

Figure 6-12. Output from the project in Figure 6-11

Starting screen for the SSG wizard

Figure 6-13. Starting screen for the SSG wizard

Enumerated view of sites that are available from the SharePoint instance

Figure 6-14. Enumerated view of sites that are available from the SharePoint instance

The SSG provides the ability to generate (or convert) an existing site definition or list definition.

Name and location to store the project

Figure 6-15. Name and location to store the project

Step-by-step tasks that the SSG runs through to generate the definition

Figure 6-16. Step-by-step tasks that the SSG runs through to generate the definition

You can run the SSG on the machine that contains the instance of SharePoint or you can choose a specific URL. Figure 6-14 shows the SSG running locally on a development machine.

When developing OBA solutions and custom site and list definitions for SharePoint, the SSG will provide you with a great tool to help build up a library of definitions that can be used for other projects. Keep your eye on the MSDN Office Developer Center for version 1.1 of Visual Studio extensions for Windows SharePoint Services!

Generated site definition opened in Visual Studio 2005

Figure 6-17. Generated site definition opened in Visual Studio 2005

Microsoft Office SharePoint Designer 2007

SharePoint Designer (SPD), previously known to everyone as Microsoft FrontPage, is the tool of choice for customizing SharePoint, both WSS and MOSS. SharePoint Designer has many capabilities that most developers are not aware of because many developers see SPD as a toy and not a professional development tool. However, if you spend a little time using SPD you will quickly see its power and how easy it makes customizing a SharePoint site. Because Microsoft Visual Studio 2005 and 2008 do not provide detailed management of SharePoint sites, SPD is the best tool to work with your content, folders, Web parts, and more. Figure 6-18 illustrates all of the various management panes provided by SPD that are connected to a Microsoft Office SharePoint Server 2007 implementation. You can manage the folder structure, get an almost 100 percent WYSIWYG view of a Web part page, view the styles of the page, and have the ability to add components from the Web parts gallery.

When you install Windows SharePoint Services, a single default master page is applied to all the pages in a site. You can, however, create your own master pages for a site and make them available to the site and any sites beneath it.

There are two supported scenarios for customizing master pages in Windows SharePoint Services:

  • Copy the default.master file that is installed with Windows SharePoint Services to another file and make your changes to your renamed file.

    Editing a master page in MOSS 2007

    Figure 6-18. Editing a master page in MOSS 2007

  • Edit the default.master page in Microsoft Office SharePoint Designer 2007, where you can edit master pages, view master pages, create content pages, and view content pages with the master pages marked as masters and read-only.

Office SharePoint Designer 2007 is the only application in which you can see a master page preview.

Figure 6-19 provides a view of the toolbox in SPD for the various SharePoint controls that are provided.

The use of the term designer in the product name can be somewhat misleading because you can do much more than simply design pieces of your SharePoint site. SPD provides the ability to customize workflows that are based on the Windows Workflow Foundation and are a key component for task automation when working with documents within an OBA solution.

Microsoft Business Data Catalog Definition Editor

The BDC Definition Editor, shown in Figure 6-20, is included with the latest release of the Microsoft Office SharePoint Server 2007 Software Development Kit available on MSDN. The BDC Definition Editor provides developers the ability to author application definition files and edit metdata for OBAs for use with the Business Data Catalog in Microsoft Office SharePoint Server 2007. The BDC is included as a feature of MOSS and is not available in WSS.

Note

Note

Metadata is data about the business applications’ APIs. For each business application, metadata defines the business entities that the business application interacts with and the methods available in the business application. Metadata authors define metadata by using XML. The Business Data Catalog stores the metadata in the metadata repository.

Toolbox showing the different SharePoint controls that can be used in SPD

Figure 6-19. Toolbox showing the different SharePoint controls that can be used in SPD

BDC Definition Editor user interface

Figure 6-20. BDC Definition Editor user interface

The BDC Definition Editor helps developers save a huge amount of time when creating application definitions, which previously had to be done through hand-coding XML—a lot of XML. For those not familiar with what an application definition looks like, Example 6-1 illustrates what is required for creating a single business entity.

Example 6-1. AdventureWorks sample application definition XML showing one business entity.

<Entity EstimatedInstanceCount="10000" Name="SalesOrder">
   <LocalizedDisplayNames>
      <LocalizedDisplayName LCID="1033">Sales Order</LocalizedDisplayName>
   </LocalizedDisplayNames>
   <Identifiers>
      <Identifier Name="SalesOrderID" TypeName="System.Int32"/>
   </Identifiers>
   <Methods>
      <Method Name="GetSalesOrders">
         <Properties>
            <Property Name="RdbCommandText" Type="System.String">
               SELECT SalesOrderID, OrderDate, SubTotal, IndividualID
               FROM SalesOrderHeader, Individual WHERE (SalesOrderID &gt;= @MinSalesOrderID)
               AND (SalesOrderID &lt;= @MaxSalesOrderID) AND (SalesOrderNumber LIKE
               @SalesOrderNumber) AND SalesOrderHeader.CustomerID = Individual.CustomerID
            </Property>
            <Property Name="RdbCommandType" Type="System.String">Text</Property>
         </Properties>
         <FilterDescriptors>
            <FilterDescriptor Type="Comparison" Name="ID" >
               <Properties>
                  <Property Name="Comparator" Type="System.String">Equals</Property>
               </Properties>
            </FilterDescriptor>
            <FilterDescriptor Type="Wildcard" Name="SalesOrderNumber"/>
         </FilterDescriptors>
         <Parameters>
            <Parameter Direction="In" Name="@MinSalesOrderID">
               <TypeDescriptor TypeName ="System.Int32" IdentifierName="SalesOrderID"
                                       AssociatedFilter="ID" Name="MinSalesOrderID">
                     <DefaultValues>
                     <DefaultValue MethodInstanceName="SalesOrderFinderInstance"
                                                    Type="System.Int32">0</DefaultValue>
                     </DefaultValues>
               </TypeDescriptor>
            </Parameter>
         <Parameter Direction="In" Name="@MaxSalesOrderID">
            <TypeDescriptor TypeName="System.Int32" IdentifierName="SalesOrderID"
                                    AssociatedFilter="ID" Name="MaxSalesOrderID">
                  <DefaultValues>
                     <DefaultValue MethodInstanceName="SalesOrderFinderInstance"
                                                  Type="System.Int32">99999999</DefaultValue>
                  </DefaultValues>
               </TypeDescriptor>
            </Parameter>
            <Parameter Direction="In" Name="@SalesOrderNumber">
               <TypeDescriptor TypeName="System.String" AssociatedFilter="SalesOrderNumber"
                                       Name="SalesOrderNumber">
                     <DefaultValues>
                     <DefaultValue MethodInstanceName="SalesOrderFinderInstance"
                                                     Type="System.String">%</DefaultValue>
                     <DefaultValue MethodInstanceName="SalesOrderSpecificFinderInstance"
                                                     Type="System.String">%</DefaultValue>
                     </DefaultValues>
                  </TypeDescriptor>
               </Parameter>
                  <Parameter Direction="Return" Name="SalesOrders">
                           <TypeDescriptor TypeName="System.Data.IDataReader, System.Data,
                              Version=2.0.3600.0, Culture=neutral,
                              PublicKeyToken=b77a5c561934e089" IsCollection="true"
                              Name="SalesOrderDataReader">
                        <TypeDescriptors>
                           <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data,
                              Version=2.0.3600.0, Culture=neutral,
                              PublicKeyToken=b77a5c561934e089"
                              Name="SalesOrderDataRecord">
                        <TypeDescriptors>
                           <TypeDescriptor TypeName="System.Int32"
                              IdentifierName="SalesOrderID" Name="SalesOrderID">
                                 <LocalizedDisplayNames>
                                    <LocalizedDisplayName LCID="1033">ID</LocalizedDisplayName>
                                 </LocalizedDisplayNames>
                           </TypeDescriptor>
                           <TypeDescriptor TypeName="System.DateTime" Name="OrderDate">
                              <LocalizedDisplayNames>
                                 <LocalizedDisplayName LCID="1033">Order Date
                                 </LocalizedDisplayName>
                              </LocalizedDisplayNames>
                                 <Properties>
                                    <Property Name="DisplayByDefault"
                                       Type="System.Boolean">true</Property>
                                 </Properties>
                                    </TypeDescriptor>
                                       <TypeDescriptor TypeName="System.Int32"
                                       Name="IndividualID">
                                          <LocalizedDisplayNames>
                                             <LocalizedDisplayName LCID="1033">IndividualID
                                             </LocalizedDisplayName>
                                          </LocalizedDisplayNames>
                                          <Properties>
                                             <Property Name="DisplayByDefault" Type="System.
                                             Boolean">true
                                             </Property>
                                          </Properties>
                                       </TypeDescriptor>
                                       <TypeDescriptor TypeName="System.Decimal" Name="SubTotal">
                                          <LocalizedDisplayNames>
                                             <LocalizedDisplayName LCID="1033">SubTotal
                                             </LocalizedDisplayName>
                                          </LocalizedDisplayNames>
                                          <Properties>
                                          <Property Name="DisplayByDefault"
                                                        Type="System.Boolean">true
                                             </Property>
                                          </Properties>
                                    </TypeDescriptor>
                                 </TypeDescriptors>
                              </TypeDescriptor>
                           </TypeDescriptors>
                        </TypeDescriptor>
                     </Parameter>
                  </Parameters>
               <MethodInstances>
            <MethodInstance Name="SalesOrderFinderInstance" Type="Finder"
                                ReturnParameterName="SalesOrders" />
            <MethodInstance Name="SalesOrderSpecificFinderInstance" Type="SpecificFinder"
                                ReturnParameterName="SalesOrders" />
         </MethodInstances>
      </Method>
   </Methods>
</Entity>

You can use the BDC Definition Editor to connect to your LOB system through Web services or a direct database connection to create and configure an instance of that LOB sytem. Once you have created and configured your LOB instance, you then can export the generated XML for that specific instance’s application definition. Once you have an application definition file, you can then add that to the BDC for use with Microsoft Office SharePoint Server 2007. Another advantage of the tool is the ability to import an existing application definition file and edit the details. The BDC Definition Editor is far from perfect, but it definitely alleviates a lot of the detailed work involved in creating application definition files.

An important point to note is that if you download and install the Microsoft Office SharePoint Server 2007 Software Development Kit (SDK), you will notice that the BDC Definition Editor is not installed by default. You will need to navigate to wherever you installed the SDK and open the Tools folder to install the tool.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset