Thursday, January 22

Error: Request for the permission of type ' ' failed in SharePoint

MOSS 2007 and Code Access Security

Have you ever written a web part or a web service? If yes then you must have dealt with a security problem. Writing a web part or web service may not be a big issue but deploying them is certainly a headache. You start getting permission errors as soon as you deploy your code on the server.

There are three ways to assign execution permissions to your code:

1. Increase the trust level for the entire virtual server
2. Create a custom policy file for your assemblies
3. Install your assemblies in the GAC

In the article, we installed our assembly in the GAC but the safest method is to create a custom policy file for the assembly.

For security reasons, the assembly must be installed in the bin directory of the application instead of GAC but installing it in the bin directory requires you to assign execution permissions to the assembly. One way is to increase the trust level of the entire virtual server. This is easy to implement but this option is least secure as it affects all assemblies used by that virtual server. Second way is to create a custom policy file and this is the recommended approach. This option is most secure but difficult to implement. In this article, we will create a custom policy file for an assembly (web service assembly) written for MOSS 2007.

Creating a Custom Policy File

1. Go to the following location on the server:

LocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG

2. Make a copy of wss_minimaltrust.config and rename it wss_customtrust.config.

3. Open wss_customtrust.config file using any text editor.

4. Under the element, add a reference to the SharePointPermissions class as follows:



5. Search for the tag where the name attribute equals ASP.NET. If you couldn't find that tag, locate the one that has SPRestricted in the name attribute.

6. Copy the entire tag and all of its children, and paste a copy of it immediately below the one you copied.

7. Change the name of the PermissionSet element from ASP.NET (or SPRestricted) to CustomTrust.

Before:


After:


8. Add the following node to the element where the name attribute equals CustomTrust:



Therefore, the resulting customized will look as follows:



9. Once you define the customized element, you must create a code group to specify when the CLR should apply the permission set. (For details, see the original Microsoft article). Locate tag where the class attribute equals FirstMatchCodeGroup and copy following CodeGroup immediately below it:



The membership condition for this new code group is based on URL membership and the URL points to the bin directory. The permissions will be applied to all the assemblies in the bin directory of the current application. You can also use strong name membership but then the permissions will be applied only to one assembly. For example, if I have written a web service and I wanted to assign permissions to my assembly only, I would use strong name membership. Copy following code immediately below the tag where the class attribute equals FirstMatchCodeGroup, if you want to use strong name membership:



Replace PublicKeyBlob value with your own value and change the name of the assembly in the Name attribute. Name attribute contains the name of the assembly. To retrieve the public key blob for an assembly, use the secutil.exe tool. Please note that publickeyblob is different from publickeytoken. Secutil.exe is located in the following folder:

LocalDrive:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin

To retrieve the public key blob for your assembly, either copy the secutil.exe tool to the folder that contains your assembly else provide exact path to the assembly in the command, and run the tool as follows:

secutil.exe -hex -s UploadService.dll > blob.txt

UploadService.dll is the name of the assembly. This command will create a text file named blob.txt. Open blob.txt and copy the public key and paste it in the publickeyblob attribute.

10. Save and close the file. The policy file is ready to use.

11. Open the web.config file for the virtual server where you have deployed your component and add the following tag to the SecurityPolicy element:




Virtual Directories for web applications are located in the following folder:

LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories

Suppose I want to deploy my web service in the web application configured at port 17316. The URL of that application would be http://localhost:17316 and its virtual directory will be:

LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories\17316

Create a bin folder in this path and copy your assembly to the bin folder. The web.config for this virtual server will be located in the following folder:

LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories\17315

In the web.config file, change the tag so that it refers to the newly defined trust level.



12. Save and close the web.config file.

13. Restart IIS to apply the custom policy to the specified virtual server.

Webpart option in Visual Studio 2008

The official way to develop MOSS 2007 WebParts is to work on a Windows Server 2003 with at least WSS 3.0 installed or to use a similar VPC environment. In the VPC case this means you need to have at least 2 GB of memory available, in order to spend 1 – 1.5 GB for the Sharepoint Server VPC.

Setting up the Developer Workstation:

1. You need a Windows XP SP2 or Windows Vista Machine with Visual Studio 2005 installed.

2. Install all Updates from Windows Update including Service Pack 1 for Team Suite or Service Pack 1 for Express Editions. If you run on Vista install the Service Pack 1 Update for Vista

3. You can optionally install WSS SDK an Office Server SDK also on your Workstation

4. Locate the Sharepoint Templates installed on the server environment and copy them to your Workstation User Templates. You have to navigate to:
“C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp”
and copy the whole Sharepoint Directory to your user Templates Folder on your Workstation. The Path is normally:
“C:\Users\\Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C#”.

If you want to develop in VB.NET do the same for the Sharepoint Folder in:
“C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\VisualBasic”

And copy it to:
“C:\Users\\Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual Basic”

Do the same for the Sharepoint Folders in the ItemTemplates Directory. There is only one for CSharp. Navigate to:
“C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp”

And copy the Sharepoint Folder to:
“C:\Users\\Documents\Visual Studio 2005\Templates\ItemTemplates\Visual C#”

5. Copy the complete Folder “Microsoft Sharepoint Developer Tools”, which can be found in “C:\Program Files” on the Server or VPC to your Workstation machine in the same location.

6. In order to register the Projects, Packages and Templates on you Workstation machine you have to add several registry keys to your Registry. Here is the whole stuff, just copy and paste it in a text file and save it with a *.reg extension:




Double click the *.reg File or import it using Regedit. In order to load the new package file, you maybe must start Visual Studio from the command line with the option /ResetSkipPkgs. Start a Command Window (on Vista this should run as an administrator) and navigate to:

“C:\Progarm Files\Microsoft Visual Studio 8\Common7\IDE”

And start Visual Studio via the following command:

Devenv /ResetSkipPkgs

Now you should be able to create new Sharepoint Projects like WebParts. To doublecheck this, in Visual Studio 2005 navigate to the Menu File->New->Project the Dialog Box should look like this:



Now select the Web Part and click Ok. Visual Studio should create the appropriate Project Files. If you click on References in the Solution Explorer you will see that there is an unresolved reference to the “Microsoft.Sharepoint” Assembly. So you can not yet build the WebPart or other Sharepoint Projects on the Workstation. Therefore the next 2 steps are necessary.

7. The Sharepoint Assemblies (DLLs) are located in the following Folder on the Sharepoint Server Installation:

“C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI”

I copied the complete folder to the same location on my Workstation, but you can also only copy the assemblies, which start with “Microsoft.Sharepoint.*” to any folder on your Workstation.

8. In order that Visual Studio can automatically resolve the references you should add the assemblies to the Global Assembly Cache” (GAC). You can use the command line tool gacutil.exe or use the “Microsoft .NET Framework 2.0 Configuration” which can be found through navigating to Control Panel, then select “Administrative Tools”.

9. Now you should be able to generate and build Sharepoint Server 2007 related projects on a remote Workstation.

Tuesday, January 20

Custom Webpart in SharePoint

I am going to explain step by step process:

1. First of all we need to create a webpart in visual studio (2005, 2008). For that, Go to File>> New>>Project.



2. Under Templates section select WebPart (this option is available only in 2008). For VS 2005, select Class Library and add reference for System.Web.



3. Write code WebPart you want to create. Here, code is written for a label having text “Hello World”.

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
namespace CustomWebPart
{
[Guid("b8f18240-bc27-4f08-a03f-61bd44279d1a")]
public class WebPart1 : System.Web.UI.WebControls.WebParts.WebPart
{
public WebPart1()
{
}
protected override void CreateChildControls()
{
base.CreateChildControls();
Label label = new Label();
label.Text = "Hello World";
this.Controls.Add(label);
}
}
}



4. Now, Buid Webpart and generate an assembly for this webpart. For that GoTo>>Build>>Build Solution. And the GoTo>>Build>>CustomWebPart.



The WebPart is now Build, we need to deploy this assembly in sharepoint site. For deploying webpart we need to perform following steps.

5. Put the assembly in the bin folder of sharepoint site. The MOSS 2007 creates every portal in the inetpub\wwwroot\wss folder. To find the path of bin folder of the portal for which you want to deploy the webpart, identified with port number, run inetmgr(IIS).

Right Click the portal and click on Properties



6. Under HomeDirectory tab, Local Path describes the whole path, copy the path and verify it by opening it in a browser and see if the bin folder exists, if it does not exist then create a new folder and rename it bin.



7. Now copy the assembly from project output folder.
C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\CustomWebPart\CustomWebPart\bin\Debug.
Paste it in the portal bin folder. C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin



Now everytime we change the webpart we need to copy and paste the assembly in portal bin folder. Hence to avoid this stuff we can do the following step which will automatically replace the new assembly in the portal bin folder.

8. In VS .Net, Solution Explorer, Right Click the project name(CustomWebPart) Click on Properties, click on Build. Into the Output Path paste the path which we copied from inetmgr console.



9. Now to make the webpart usable we need to modify the web.config file of the portal. To declare the control safe we need to add a entry in web.config file.



10. For tag we require a parameter “PublicTokenKey” to generate this key drag the assembly from project folder and drop it in C:/Windows/assembly folder and it will generate a publictokenkey.



Right Click on CustomWebPart and copy Public Key Token.
Open web.config file and enter the following text :

.....
.....
Namespace="CustomWebPart" TypeName="*" Safe="True"
AllowRemoteDesigner="True" />





11. Now we need to Configure Portal to use CustomWebPart.
Till now the web part has been created and deployed to the site directory. Now the next part is how to use the web part on the Portal’s Site. The web part created can be placed on any site of the portal.
Open the portal site in the internet explorer, in my case its http://win2003, ensure that the logged in user has the administrative rights on the portal site, else it will not allow adding the web part.

12. Click on the Site Action>>Site Settings



13. On the site settings page under Galleries column click on the Web Parts.



14. On the Web Part Gallery Page click on the New button, to add the new web part assembly to the gallery.



15. On the New Web Parts page locate the CustomWebPart in the list, check the check box on the left and click on the Populate Gallery button the top of the page. This will result in the Web Part entry creation in the Web Part Gallery list, and hence it can be used from now on from the gallery.



Now the Web Part is ready to be added to the page.

16. Open a site created in the Portal. Click on Site Action>>Edit Page



17. This will modify the appearance of the page to enable the edit view. In this view Web Part Zones are highlighted so that a user can add a web part to the zone, Click on the Add a Web Part button in the left zone to add the Web Part.




18. Select the CustomWebPart from the web part list . It is found under the Miscellaneous section and then click on Add.



19. Click on the Exit Edit Mode link on the page and the site will return to the view mode.
20. At the end the page will appear like this.

Metastorm BPM™ Architecture

An Enterprise BPM Solution

The Metastorm BPM software suite provides a highly-scalable enterprise platform on which solutions can be quickly and easily deployed and customized to meet the unique and dynamic process needs of any organization. Metastorm BPM supports both human-based and systembased processes across the full business process management life-cycle, including the design, automation, and management of multiple processes across an organization – with an emphasis on enabling real-time, roundtrip process improvement through a combination of modeling, integration, execution, simulation and analytics technologies all orchestrated through a single interface. The process suite is the best in its class – supporting dynamic roles, advanced business rules defi nition, form creation and packaged high-performance integration to multiple back-end systems, regardless of platform. Metastorm BPM also provides powerful timephased reporting, performance monitoring, and predictive analysis capabilities. Metastorm’s BPM software and methodologies are unmatched in their ability to quickly implement complex processes and support rapid changes – delivering the fastest ROI and lowest total cost of ownership for partners and customers.

Metastorm BPM’s leverages an advanced XML-based architecture to provide a highly distributed, scalable infrastructure which connects every member of the business process community: employees, customers, suppliers and business partners. Metastorm BPM uses a .NET Process Engine to provide a highly scaleable platform for managing the authorization, role management, work assignment, and system integration for thousands of on line users. Metastorm BPM automates and tracks the progress of all steps and activities in a process and organizes the work of all process participants, both human and system. Using XML, Web Services, .NET, Java, and Messaging, Metastorm BPM enables the bi-directional exchange of business information, so that all constituents can interact securely over the intranets and the Internet. Furthermore, Metastorm BPM leverages XML to dynamically build user interfaces based on role-based access privileges, the device/browser type being used and business logic, thereby tailoring and controlling information access to a specifi c process context.

Metastorm BPM Architecture

Metastorm BPM uses a XML-based, stateless design complimented by service oriented architecture (SOA) to support scalability as the enterprise environment grows. Metastorm BPM’s unique, business-centric architecture incorporates technology services (authentication, web services, XML document transformation, etc) and business services (business rules, reporting and analytics, etc.) in a services oriented fashion and also allows the unique business processes captured during the modeling phase to be published as high level business services using standards such as SOAP and WSDL.

The Metastorm BPM architecture is depicted below:



The following sections discuss the architecture of each layer:

• Client Layer
• Transformation Layer
• Process Layer
• Integration Layer

Client Layer

This layer provides users with Intranet and Internet access to Metastorm BPM, whether by:

• A browser: Metastorm BPM supports Microsoft Internet Explorer as a full-function zero footprint client. Third parties have added support for other browsers and devices (such as WAP phones) by means of Transformation Layer extensions.

• A universal client: Metastorm BPM allows process participants and observers to use desktop productivity tools such as Microsoft Outlook as full-function clients. Third parties may add support for other client solutions by writing an appropriate Client Adapter, which is a thin layer of software that integrates the Metastorm BPM Client Components.

• A process portal client: Metastorm BPM provides access to Watch and To Do lists, dashboards, process forms, reports, and administrative tools via popular portal technologies such as Microsoft Windows SharePoint Services and SharePoint Server. Third parties provide portal components for other portals such as Lotus Notes and IBM WebSphere.

• A custom client: Metastorm BPM provides an API (using XML, HTML, PDF, .NET, Java, Web Services, and Messaging) by means of which any application (with or without a UI) may act as a Metastorm BPM client. For Microsoft ASP.NET development Metastorm BPM includes a set of .NET server-side controls that allow the rapid authoring of ASP.NET and SharePoint Web Parts interfaces. The Metastorm BPM Java sample client provides a jump start on delivering a fully functional Java and JSP-based client.

Browser and universal client interfaces provide a standard user interface and navigational framework for solutions, consisting of a set of default navigation pages and user interface objects. Solution developers can easily modify, extend and create alternative user interface screens to a variety of devices on the Internet. Examples include the ability to change a solution’s look and feel, incorporate new pages with external functionality (under single sign-on and Metastorm BPM’s access control model), create specifi c user interfaces for specifi c user roles and/or other dynamic parameters, and detect the browser type in real-time to display device specifi c screens.

Browser, SharePoint and universal clients also allow access to Metastorm BPM’s process intelligence client – Metastorm Insight. The Metastorm Insight client allows the deployment of sophisticated process performance dashboards and Metastorm BPM’s unique actionable management reports. The Insight client is tightly integrated into Metastorm BPM and fully leverages the Open Authentication and Enterprise Roles Management components of Metastorm BPM.

All types of clients may make use of client-side automation servers (typically desktop solutions) by means of Metastorm BPM open scripting capabilities. Scripts may be written in a wide range of languages, including JavaScript and VBScript.

Transformation Layer

This layer is designed to integrate processes involving multiple enterprises across firewalls. These processes involve the movement of documents and information from one participating enterprise to another according to rules or procedures as well as invoking applications to produce or consume this information. It provides support for:

• Intranet and Internet clients: Metastorm BPM’s XML interface converts Metastorm BPM’s own XML request and response messages to and from the DHTML, PDF, and other page formats required by thin clients.

• Messaging Integration: XML interfaces may also convert between Metastorm BPM’s own XML structures and those used by other interfaces services such as web services and messaging platforms. Metastorm BPM provides a platform for the bi-directional exchange of business data and services – without the need for expensive integration such as electronic data interchange (EDI). For key platforms such as Microsoft BizTalk Server, IBM WebSphere Message Queuing, Microsoft Message Queuing (MSMQ) and Java Messaging Services, Metastorm BPM provides pre-build adapters and tools.
Metastorm BPM’s XML messages may be “smart messages” containing commands (scripts) embedded in the XML as well as the data. These commands are universal in that they can be interpreted and executed by external systems. This architecture makes these messages as powerful as programs that can be executed by any browser that supports the language.

To insure secure process participation, Metastorm BPM fully supports HTTP/S for communications. The combination of XML and HTTP/S allows Metastorm BPM to interoperate with almost all remote objects, independent of the language and platform upon which they reside. Corporate fi rewalls present no problem because of the use of HTTP/S. The ubiquity of XML as a data communication protocol and the security offered by HTTP/S allow Metastorm BPM to natively provide the same level of interoperability that many other vendors achieve through complex cross-platform bridges, thus minimizing the requirement unnecessary and often overly-complicated middleware and infrastructure.

For installations that do not wish to host their Web server on a Microsoft Windows platform, a Web Proxy may be run on any of a number of non-Windows Web servers, as a front-end to an internal ‘behind the fi rewall’ Windows Web server.

Process Layer

The Process layer is where the Metastorm Process Engine resides. This layer parses and transforms XML documents, passes the requests to the XML-based Process Engine to determine the next stage in the process, and stores the solution data in a relational database. The process layer handles all the state and logic processing of the inter-enterprise processes as well as session management, access control, content management, and interfacing with the database through a pool of open database connections for scalability. The session management mechanism allows Metastorm BPM to provide robust authentication and a comprehensive audit trail in order to meet or exceed industry standards and regulations. The access control mechanism provides the ability to control users’ access to data and functions with very fine granularity. The content management function delivers fl exible content to both consumers and legacy systems by dynamically constructing data based on how the solution is designed.

Metastorm BPM processes, business rules, user interface forms, system integrations, and database tables are developed using the Metastorm BPM Designer component. Once a process is built, it is published directly to the Metastorm BPM repository database from which the Metastorm BPM Process Engine reads and interprets the solution. A number of Metastorm BPM administrative capabilities are also provided to aid in the maintenance of a Metastorm BPM installation. Using the Metastorm Insight process intelligence server, real-time and historical reports are available – and can be used to extract information from the Metastorm BPM database, combining process performance data with a customer’s unique “Line of Business” information.
Also included in the Process Layer is Metastorm Envision which provides advanced simulation and analysis of Metastorm BPM processes both pre-and post deployment. Process performance can be simulated; adjustments made, and detailed comparisons performed. Once a process is deployed and an organization has accumulated process performance data, Metastorm Envision can be used to analyze this performance. New simulations may be run using actual performance data.

The Metastorm BPM architecture supports two complementary techniques for modeling data and defining the database structure. In addition to the conventional way of defining a database by having a database analyst defi ne the schema (“inside-out”), Metastorm BPM allows solution developers or business analysts to perform data modeling via the Metastorm Designer (“outside in”). That is, Metastorm BPM supports schema definition by automatically translating the form definition into a database schema. Alternatively, it also allows forms to bind their fields with the fields in the existing database schema for customers who prefer to use conventional data modeling. The combination of support for both “outside-in” and “inside-out” data modeling accelerates development while allowing Metastorm BPM solutions to have well controlled data structures.

Integration Layer

While Metastorm BPM’s Transformation Layer is designed to integrate processes involving multiple enterprises across firewalls, using XML and HTTP/S, many legacy solutions today are not internet enabled, and not all those that are cleanly support native XML. Many corporate ‘behind the firewall’ applications and data stores hold data and programs of great use to a Metastorm BPM solution. To address this issue, Metastorm BPM also provides Integration Layer.

The Integration Layer provides access to these solutions and data stores via the following mechanisms:

• The Metastorm Integration Manager (MIM). The MIM is an advanced integration tool for managing and controlling system-based processes, allowing Metastorm BPM to oversee the entire business process and gaining critical visibility and performance data needed to fine-tune and optimize both human and system-based activities (i.e. the full roundtrip on both sides of the equation). The MIM includes integration for a wide range of hosts, UNIX, and Windows platforms, providing access to databases, fl at fi les, VSAM and other host file types, message queues, CICS, and other business data and business function services.

• Scripts may be associated (via the Designer) with Metastorm BPM events. The Designer provides syntax-sensitive editors for JavaScript, VBScript, and jScript.NET. Scripts may be used to drive any .NET or COM-enabled solution. In particular, there are many solution integration products (interface engines or message brokers) that handle protocol conversion as well as message format conversion. The Metastorm BPM Integrator may be used in conjunction with any of these integration products to seamlessly interface with existing systems.

• Metastorm BPM stores its own internal data in either Microsoft SQL Server, or Oracle. However, data can also be read from and written to any ODBC or OLEDB compliant external databases.

. User and role-related information can be extracted automatically from LDAP-compliant directories, or from ODBC compliant database. This saves administrators from having to maintain the same information in two or more different places.

• Integration with legacy system integration tools such as Web Logic Integrator, Software AG’s EntireX, and the entire suite of iWay adapters.

• Universal Process Orchestration Kit - a Metastorm component that delivers a single application programming interface (API) for organizations to integrate, manage and control multiple processes across disparate Java, .NET, and Web Service environments. Each UPO kit includes
- Metastorm BPM Enterprise Class Libraries (ECL). – a complete set of APIs to the Metastorm Process Engine for Java, .NET, Web Services, and Messaging.
- Metastorm Activator – Allows application components for Java, .NET, and Web Services to be orchestrated using a Metastorm BPM process.
- Platform specifi c features such as JAAS support and .NET Visual Components, and ASP.NET server controls.

• Complex shared business rules stored in industry standard business rules environments such as Blaze Advisor or Microsoft BizTalk can be tightly integrated into a business process.

Scalability and Performance

Metastorm BPM is an enterprise-class, fully stateless system whose scalability meets the requirements of large, distributed organizations. The platform architecture scales “up” through symmetric multiprocessing (SMP) and faster CPUs, and it scales “out” linearly with the number of servers. Multiple Metastorm Process Engines can run against a single database. All database accesses are done through standard ODBC ADO or JDBC, so that the database and Metastorm BPM servers can reside on different servers. Metastorm BPM ensures load balancing among multiple Metastorm Process Engines by dispatching requests to each server using a dynamic load balancing algorithm. Additionally, the cluster confi guration supports load balancing features provided by the Microsoft as well as other hardware and software based load balancing mechanisms. As the system load increases, Metastorm BPM architecture ensures that the overall system scales up optimally with the number of servers and the processing capacity of each server.

Scalability and high-performance are inherent features of Metastorm BPM because of its stateless and transactional design. Client processes communicate with the Metastorm BPM Process Engine using semantically-rich but compact XML messaging. All interactions with the Metastorm Process Engine are treated as transactions with no state being held between transactions. Resources are allocated for an individual transaction and freed upon completion.

As a result, a higher order of requests can be processed with the absolute minimum of resource requirements. On the other hand pooling and resource management techniques are utilized so that overhead of resource instantiation does not counterweight the benefi ts of Metastorm BPM’s stateless design.

The Metastorm Process Engine implements and benefi ts from the stateless design. Implemented using, .NET, C++, and C#, the Metastorm BPM server is a robust set of high-performance multi-threaded components. The Metastorm Process Engine processes all Metastorm BPM transactions in isolated fashion using advanced thread management and resource allocation. This prevents critical resource deadlocks and enables system administrators to easily correlate user load and resource usage for better capacity planning.

To further enhance scalability, the Metastorm Process Engine offers built in asynchronous processing for tasks such as notifi cations and external events (Raise Flag). Asynchronous processing allows the Metastorm Process Engine to perform event-driven tasks without affecting transaction processing.

In addition, Metastorm BPM leverages the scalability features offered by .NET and Windows Enterprise Services. Its implementation as a set of stateless .NET and Windows Enterprise Services components benefi ts from Just-in-time (JIT) activation, a key Windows Enterprise Services scalability enhancement for multi-tier applications. JIT activation impacts the binding between a client and an engine server component. It offers Metastorm BPM clients the capability of holding a durable reference to a server component while optimizing system resources used on behalf of the server. Server component instances are deactivated as soon as transactions are completed freeing memory resources for other connections thus resulting into higher scalability.

As JIT activation optimizes client connectivity to the Metastorm Process Engine, similarly, the built-in Windows Enterprise Services resource pooling benefi ts Metastorm Process Engine connections to database servers. A confi gurable pool of database connections is maintained and reused for Metastorm transactions. All Metastorm BPM database transactions are performed through this connection pool.
Given that establishing connections to a database server is expensive in performance and resource terms, this greatly enhances Metastorm BPM’s performance and scalability. This extends to access to external databases, since all database access is performed using Microsoft’s Database Access Components (MSDAC).

Security

Metastorm recognizes that one of the key concerns in any web-based system is security. Data transmission, information storage, and transactions all need to be protected and kept confi dential for the sake of consumers, as well as regulators and accreditation bodies.

Authentication: Metastorm BPM authenticates a user’s identity through a private username and encrypted password. Stronger forms of authentication via PKI, certificates, tokens and/or smartcards may be supported through integration with technology from other vendors of Metastorm BPM has a comprehensive Open Authentication Architecture that allows integration with a wide range of authorization systems including both server and client side security systems.

Authorization: Metastorm BPM supports strong role-based access control and session management. Access control, authentication, and authorization are closely linked on the Internet. Only when the identity of an object has been authenticated, is that object granted access rights. Metastorm BPM provides a sophisticated and flexible enterprise roles-based access control model, with very granular control down to the form field level.

Encryption: Metastorm BPM ensures that transmitted data is disclosed only to intend recipients through Internet encryption techniques. Metastorm BPM leverages industry-standard Secure Sockets Layer (SSL), Virtual Private Network (VPN), and X.509 on Web browsers and servers.

Auditing: Metastorm BPM provides a complete audit trail to all Metastorm BPM transactions. Every update to the Metastorm BPM database is logged and available as an audit trail.

Summary

Metastorm BPM is a state-of-the-art Business Process Management software platform for developing and deploying agile solutions – connecting users, applications and systems within and outside an organization to close critical gaps and streamline mission-critical business processes. Metastorm BPM’s capability spans from user interaction and personalization to information integration. It supports and integrates multiple enterprises simultaneously while ensuring solution interoperability and scalability when the enterprise environment grows. In addition, Metastorm BPM solutions are secure and easily deployed either at the customer site or hosted off-site through an ASP or BPO model.

Its Web-centric, service-oriented architecture enables the secure online exchange of business documents and high volume Internet transactions – all with the highest levels of adaptability to customer environments. The vast array of client interface options and fl exible, open architecture make it the ideal solution for automating, managing, and controlling the unique, human-based – and often complex – processes that drive organizational success.

Monday, January 19

SharePoint Web Services

1. Introduction

SharePoint web services allow remote applications to get and modify SharePoint sites and content.

• Windows SharePoint Services v3 comes with 16 web services.
• Microsoft Office SharePoint Services supports 5 additional web services.
• These services can be used from any web-service aware programming language such as Visual Basic .NET, C#, C++, VBA, Java, and so on.

We can add reference to SharePoint web service using visual studio IDE. The SharePoint web services are implemented in ASP.NET web services. So its extension is .ASMX.

• Physical files for most of these web services are saved in the "Microsoft Shared" directory under "web server extensions\12\ISAPI" typically located at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI".

• The admin web service for the Central Administration tool is located in the ADMISAPI folder for which the central administration console contains a virtual directory named "_vti_adm".

When a SharePoint site is created it will contain a virtual directory named “_vti_bin” that points to the location of “_vti_adm”.
IIS does not have any information about any virtual directory, however IIS contain mapping to the “_vti_bin” through SharePoint metadata and HttpModules.
For each service there is a *.wsdl.aspx file; that generates the service WSDL (Web Services Description Language), a *.disco.aspx providing the service discovery implementation, and the actual *.asmx endpoint files, most of which simply contain a page directive referencing the SharePoint assembly and type containing the actual implementation for the service.



2. List of All Web Services

Web Services found in WSS v3.

1. Administration Web Service
2. Alerts Web Service
3. Document Workspace Web Service
4. Forms Web Service
5. Imaging Web Service
6. List Data Retrieval Web Service
7. Lists Web Service
8. Meetings Web Service
9. Permissions Web Service
10. Site Data Web Services
11. Sites Web Services
12. Users and Group Web Services
13. Versions Web Services
14. Views Web Services
15. Web Part Pages Web Services
16. Webs Web Services

Web Services found in MOSS 2007.

1. Authentication Web Service
2. Copy Web Service
3. People Web Service
4. SharePoint Directory Management Service
5. Search Web Service

3. Brief Description about the Web Services

WSS v3 Web Services

1. Administration Service (Admin.asmx)

The Administration service provides methods for managing a deployment of Microsoft Windows SharePoint Services, such as for creating or deleting site collections.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name:Port_Number/_vti_adm/Admin.asmx

2. Alerts Service (Alerts.asmx)

The Alerts service provides methods for working with alerts for list items in a SharePoint site.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Alerts.asmx

3. Document Workspace Service (Dws.asmx)

The Document Workspace Web service exposes methods for managing Document Workspace sites and the data they contain. The Document Workspace service is used by Microsoft Office Outlook 2003 in the context of its Shared Attachments feature.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/_vti_bin/Dws.asmx

4. Forms Service (Forms.asmx)

The Forms service provides methods for returning forms that are used in the user interface when working with the contents of a list.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Forms.asmx

5. Imaging Service (Imaging.asmx)

The Imaging service provides methods that enable to create and manage picture libraries.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Imaging.asmx

6. List Data Retrieval Service (DspSts.asmx)

The List Data Retrieval Service provides a method for performing queries against lists in Microsoft Windows SharePoint Services.

Requirements

Namespace: Microsoft.SharePoint.Dsp.Sts
Assembly: Microsoft.SharePoint.Dsp.Sts (in Microsoft.SharePoint.Dsp.Sts.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/DspSts.asmx

7. Lists Service (Lists.asmx)

The Lists service provides methods for working with lists and list data.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Lists.asmx

8. Meetings Service (Meetings.asmx)

The Meetings service provides methods that enable to create and manage Meeting Workspace sites.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Meetings.asmx

9. Permissions Service (Permissions.asmx)

The Permissions service provides methods for working with the permissions for a site or list.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Permissions.asmx
10. Site Data Service (SiteData.asmx)

The Site Data service provides methods that return metadata or list data from sites or lists in Microsoft Windows SharePoint Services.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/SiteData.asmx

11. Sites Service (Sites.asmx)

The Sites service provides a method for returning information about the collection of site templates on the virtual server.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Sites.asmx

12. Users and Groups Service (UserGroup.asmx)

The Users and Groups service provides methods for working with users, site groups, and cross-site groups.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/UserGroup.asmx

13. Versions Service (Versions.asmx)

The Versions service provides methods for working with file versions.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Versions.asmx

14. Views Service (Views.asmx)

The Views service provides methods for working with views of lists.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Views.asmx

15. Web Part Pages Service (WebPartPages.asmx)

The Web Part Pages service provides methods to send information to and retrieve information from XML Web services.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)
Web Reference: http://Server_Name[sites/][Site_Name/]/_vti_bin/WebPartPages.asmx

16 .Webs Service (Webs.asmx)

The Webs service provides methods for working with sites and sub sites.

Requirements

Namespace: Microsoft.SharePoint.SoapServer
Assembly: Windows SharePoint Services Web Service (in STSSOAP.dll)
Web Reference: http://Server_Name/[sites/][Site_Name/]_vti_bin/Webs.asmx

MOSS 2007 Web Services

1. Authentication Web Service (Authentication.asmx):Provides classes for logging on to a SharePoint site that is using forms-based authentication.

2. Copy Web Service (Copy.asmx): Provides services for copying files within a SharePoint site and between SharePoint sites.
Web Reference: http:///_vti_bin/Copy.asmx

3. People Web Service (People.asmx): Provides classes that can be used to associate user identifiers (IDs) with security groups for Windows SharePoint Services Web site permissions.

User IDs are validated against Active Directory Domain Services (ADDS) as well as various role or membership providers. SPGroup security information may also be stored in a collection of cross-site groups for the site collection.
Web Reference: http:///_vti_bin/People.asmx

4. SharePoint Directory Management Service (SharePointemailws.asmx)
Provides classes that enable requests for various management operations for e-mail distribution groups.
5. Search Web Service (Search.asmx)
Enterprise Search in Microsoft Office SharePoint Server 2007 exposes its search functionalities through the Query Web service. This allows you to access Enterprise Search results from client applications and Web applications outside of the context of a SharePoint site.
Web reference: http://[site]/_vti_bin/search.asmx.


4. List of Web Methods of all the Web Services

















Web services in a SharePoint Site

Following will give you an overview of different Web Services in a SharePoint site.

1. Administration Web Service:Provides methods for managing a deployment of Windows SharePoint Services, such as for creating or deleting sites.

2. Alerts Web Service: Provides methods for working with alerts for list items in a SharePoint site.

3. Authentication Web Service: Provides classes for logging on to a SharePoint site that is using forms-based authentication.

4. Copy Web Service: Provides methods for copying items between locations in Windows SharePoint Services.

5. DocumentWorkspace Web Service: Provides methods for managing Document Workspace sites and the data they contain.

6. Forms Web Service: Provides methods for returning forms used in the user interface when working with the contents of a list.

7. Imaging Web Service: Provides methods that enable you to create and manage picture libraries.

8. ListDataRetrieval Web Service: Provides a method for performing queries against lists in Windows SharePoint Services.

9. Lists Web Service: Provides methods for working with lists and list data.

10. Meetings Web Service: Provides methods that enable you to create and manage Meeting Workspace sites.

11. People Web Service: Provides methods for working with security groups.

12. Permissions Web Service: Provides methods for working with the permissions for a site or list.

13. SharepointDirectoryManagementService Web Service: Provides methods for remotely managing distribution groups.

14. SiteData Web Service: Provides methods that return metadata or list data from sites or lists in Windows SharePoint Services.

15. Sites Web Service: Provides a method for returning information about the site templates for a site collection.

16. SPSearch Web Service: Provides methods for remotely performing searches within a Windows SharePoint Services deployment.

17. UsersGroups Web Service: Provides methods for working with users, site groups, and cross-site groups.

18. Versions Web Service: Provides methods for working with file versions.

19. Views Web Service: Provides methods for working with views of lists.

20. WebPartPages Web Service: Provides methods to send and retrieve Web Part information to and from Web services.

21. Webs Web Service: Provides methods for working with sites and sub sites.

Service Administration (_vti_adm/Admin.asmx) Administrative methods for creating deleting sites and retrieving languages used in the deployment

• CreateSite
• DeleteSite
• GetLanguage
• RefreshConfigCache

Alerts (Alerts.asmx) Methods for working with SharePoint list item alerts

• DeleteAlerts
• GetAlerts

Authentication (Authentication.asmx) Client proxy that provides user authentication for sites that use forms-based authentication

• Login (Used to authenticate)
• Mode (Returns the authentication mode of the current site)

Copy (Copy.asmx) Methods to copy files between or within sites

• CopyIntoItems (Copy document as byte array to location on server)
• CopyIntoItemsLocal (Copy document from one location on the same server to another)
• GetItem (Creates a byte array of a document that can be passed to theCopyIntoItems method)

Document Workspace (Dws.asmx) Methods for managing Document Workspace sites and data

• CanCreateDwsUrl
• CreateDws
• CreateFolder
• FindDwsDoc
• GetDwsData
• GetDwsMetaData
• RemoveDwsUser
• RenameDws
• UpdateDwsData

Forms (Forms.asmx) Methods for returning forms that are used in the user interface when working with the contents of a list

• GetForm
• GetFormCollection

Imaging (Imaging.asmx) Methods to create and manager picture libraries

• CheckSubwebAndList
• CreateNewFolder
• Delete
• Download
• Edit
• GetItemsByIds
• GetItemsXMLData
• GetListItems
• ListPictureLibrary
• Rename
• Upload

List Data Retrieval (DspSts.asmx) Perform queries against sites and list in SharePoint

• Query (Performs queries against SharePoint lists and sites)

Lists (Lists.asmx) Methods for working with Lists and List Data

• AddAttachment
• AddDiscussionBoardItem
• AddList
• AddListFromFeature
• ApplyContentTypeToList
• DeleteAttachment
• DeleteContentType
• DeleteContentTypeXmlDocument
• DeleteList
• GetAttachmentCollection
• GetList
• GetListAndView
• GetListCollection
• GetListContentType
• GetListContentTypes
• GetListItemChanges
• GetListItemChangesSinceToken
• GetListItems
• GetVersionCollection
• UndoCheckout
• UpdateContentType
• UpdateContentTypesXmlDocument
• UpdateContentTypeXmlDocument
• UpdateList
• UpdateListItems

Meetings(Meetings.asmx) Create and manage Meeting Workspace Sites

• AddMeeting
• AddMeetingFromICal
• CreateWorkspace
• DeleteWorkspace
• GetMeetingInformation
• GetMeetingWorkspaces
• RemoveMeeting
• RestoreMeeting
• SetAttendeeResponse
• SetWorkspaceTitle
• UpdateMeeting
• UpdateMeetingFromICal

People(People.asmx) Resolve and find Principals

• ResolvePrincipals

Permissions (Permissions.asmx) Methods for working with permissions for a site or list

• AddPermission
• AddPermissionCollection
• GetPermissionCollection
• RemovePermission
• RemovePermissionCollection
• UpdatePermission

Directory Management(sharepointemailws.asmx) Methods for managing Active Directory e-mail distribution groups and their memberships

• ChangeContactsMembershipInDistributionGroup
• ChangeUsersmembershipInDistributionGroup
• CreateContact
• CreateDistributionGroup
• DeleteContact
• DeleteDistributionGroup
• GetJobStatus
• ModifyContact
• ModifyDistributionGroup
• RenameDistributionGroup

Site Data (SiteData.asmx) Methods that return metadata or list data from sites or lists

• EnumerateFolder
• GetAttachments
• GetChanges
• GetContent
• GetList
• GetListCollection
• GetListItems
• GetSite
• GetSiteAndWeb
• GetSiteUrl
• GetURLSegments
• GetWeb

Sites(Sites.asmx) Methods for returning information about the collection or site template

• ExportWeb
• GetSiteTemplates
• GetUpdatedFormDigest
• ImportWeb

Search(spsearch.asmx) Methods for searching via search services

• Query
• QueryEx
• Registration
• Status

Users & Groups(usergroup.asmx) Methods for working with users role definitions and groups

• AddGroup
• AddGroupToRole
• AddRole
• AddRoleDef
• AddUserCollectionToGroup
• AddUserCollectionToRole
• AddUserToGroup
• AddUserToRole
• GetAllUserCollectionFromWeb
• GetGroupCollection
• GetList
• GetListAndView
• GetListCollection
• GetGroupCollectionFromRole
• GetGroupCollectionFromSite
• GetGroupCollectionFromUser
• GetGroupCollectionFromWeb
• GetGroupInfo
• GetRoleCollection
• GetRoleCollectionFromGroup
• GetRoleCollectionFromUser
• GetRoleCollectionFromWeb
• GetRoleInfo
• GetRolesAndPermissionsForCurrentUser
• GetRolesAndPermissionsForSite
• GetUserCollection
• GetUserCollectionFromGroup
• GetUserCollectionFromRole
• GetUserCollectionFromSite
• GetUserCollectionFromWeb
• GetUserInfo
• GetUserLoginFromEmail
• RemoveGroup
• RemoveGroupFromRole
• RemoveRole
• RemoveUserCollectionFromGroup
• RemoveUserCollectionFromRole
• RemoveUserCollectionFromSite
• RemoveUserFromGroup
• RemoveUserFromRole
• RemoveUserFromSite
• RemoveUserFromWeb
• UpdateGroupInfo
• UpdateRoleDefInfo
• UpdateRoleInfo
• UpdateUserInfo

Versions (Versions.asmx) Methods for working with file versions

• DeleteAllVersions
• DeleteVersion
• GetVersions
• RestoreVersion

Views(Views.asmx) Methods for working with list views

• AddView
• DeleteView
• GetViewCollection
• GetViewHtml
• UpdateView
• UpdateViewHtml
• UpdateViewHtml2

Web Part Pages(WebPartPages.asmx) Methods for working with Web Part Pages

• AddWebPart
• AddWebPartToZone
• AssociateWorkflowMarkup
• ConvertWebPartFormat
• DeleteWebPart
• ExecuteProxyUpdates
• FetchLegalWorkflowActions
• GetAssemblyMetaData
• GetBindingResourceData
• GetCustomControlList
• GetDataFromDataSourceControl
• GetFormCapabilityFromDataSourceControl
• GetSafeAssemblyInfo
• GetWebPart
• GetWebPart2
• GetWebPartCrossPageCompatibility
• GetWebPartPage
• GetWebPartPageConnectionInfo
• GetWebPartPageDocument
• GetWebPartProperties
• GetWebPartProperties2
• RemoveWorkflowAssociation
• RenderWebPartForEdit
• SaveWebPart
• SaveWebPart2
• ValidateWorkflowMarkupAndCreateSupportObjects

Webs(Webs.asmx) Methods for working with sites and subsites

• CreateContentType
• CustomizeCss
• DeleteContentType
• GetActivatedFeatures
• GetAllSubWebCollection
• GetColumns
• GetContentType
• GetContentTypes
• GetCustomizedPageStatus
• GetListTemplates
• GetWeb
• GetWebCollection
• RemoveContentTypeXmlDocument
• RevertAllFileContentStreams
• RevertCss
• RevertFileContentStream
• UpdateColumns
• UpdateContentType
• UpdateContentTypeXmlDocument
• WebUrlFromPageUrl

MOSS Search (Search.asmx) Methods for searching via MOSS (Microsoft Office SharePoint Server) Search services, which also includes a method to retrieve the managed search properties

• GetSearchMetadata (Search managed properties)
• Query
• QueryEx
• Registration
• Status

Friday, January 16

Adding Validation to a Custom List Control in Sharepoint

Introduction

Recently, one of the requirements was to put validation to a custom list control such as Email field validation.This validation can be achieved from inside the Sharepoint designer. Following is a step by step walkthrough to validate a list field.

Background

You should know how to create a Sharepoint list and how to open the site in Sharepoint designer.

1. Following is a list with Email fields. Let's say we have to validate so that only a valid email can be entered.

If not valid, then the Error Message appears next to the field:



2. Now open the site in the Sharepoint designer and then expand the list and open the Newform.aspx of the list to be validated:



3. As you can see in the image above, the Newform.aspx of Validation list is being opened in the Sharepoint designer.

4. Now right click on this Validation list Web part in Sharepoint designer and choose Web Part properties:



5. The properties dialog box will open for the Validation list here. Choose Hidden under layout and say OK.

(This web part can be deleted as well, but due to some known problems because of deletion, it is best to hide this).



6. Now click exactly underneath the hidden list web part and go to Insert->Sharepoint Controls-> Custom List Form… and the Wizard will ask to choose a List or Document Library form based on existing list.

Choose your Validation list and select New item form under type of form to create option and hit Ok.



7. You will get the Validation List underneath the hidden list as shown as selected image below:



8. Now from here, we can customize all the controls based on requirement. As we are customizing the E-Mail field, right click on the email field box and choose Show common control tasks from the context menu:



9. This will give you Common Formfield tasks option as shown below next to the Email field. Here we can change the format of the data field selected (default is List form field). As we need Email field to be textbox where validation can be applied, Choose Textbox from Format as dropdown instead of List form field.



10. After the above step, List will look like this (custom formatted):



11. Now drop a RegularExpressionValidator control from the Validation option under ASP.NET controls from the toolbar as shown below:



12. Now specify the required properties (such as ControlToValidate, ErrorMessage, SetFocusOnError to true, Validate Expression) of the RegularExpressionValidator from the Tag Properties toolbar. For ControlToValidate, choose the ID of the Email field.

After selecting it and getting the ID from the Tag Properties toolbar as you do in Visual Studio, see below the set attributes in blue for the Email field:



13. Now, save the changes and go back to the list in Internet Explorer and try to type in an invalid email id and you will get the following:



Happy Sharepointing…