PCT403 – SharePoint and WSS: Allowing Your Code to Work with Both Eugene Rosenfeld Black Blade Associates

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

PCT303 – Content Publishing in SharePoint Eugene Rosenfeld Black Blade Associates
Malek Kemmou Technology Architect, Application Platform Microsoft Middle East and Africa Overview of ASP.NET 2.0.
Program Verification Using the Spec# Programming System ETAPS Tutorial K. Rustan M. Leino, Microsoft Research, Redmond Rosemary Monahan, NUIM Maynooth.
Better SharePoint through Service Oriented Architecture and Development DEV346, PM346.
Technical - SharePoint SharePoint grew out of the Exchange Development Teams collaboration work and Digital Dashboard initiative. SharePoint Team Services.
Needles in a Haystack Harnessing the SharePoint Search Engine Presenter: Ivan Wilson – SharePoint Gurus.
Error-handling using exceptions
CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
JLab Lattice Portal – Data Grid Web Service Ying Chen, Chip Watson Thomas Jefferson National Accelerator Facility.
Presenter: James Huang Date: Sept. 29,  HTTP and WWW  Bottle Web Framework  Request Routing  Sending Static Files  Handling HTML  HTTP Errors.
Presentation 10 SOAP on the Microsoft Platform (.NET)
Building Localized Applications with Microsoft.NET Framework and Visual Studio.NET Achim Ruopp International Program Manager Microsoft Corp.
METHOD OVERRIDING Sub class can override the methods defined by the super class. Overridden Methods in the sub classes should have same name, same signature.
5.04 Apply Decision Making Structures
PCT401 – Security for the SharePoint Developer Eugene Rosenfeld Black Blade Associates
Remote Method Invocation Chin-Chih Chang. Java Remote Object Invocation In Java, the object is serialized before being passed as a parameter to an RMI.
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Session 11: Security with ASP.NET
JavaScript & jQuery the missing manual Chapter 11
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Integrating CFML with ASP.NET Vince Bonfanti President New Atlanta Communications, LLC.
.NET Framework & C#.
14 Publishing a Web Site Section 14.1 Identify the technical needs of a Web server Evaluate Web hosts Compare and contrast internal and external Web hosting.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
.NET Framework Danish Sami UG Lead.NetFoundry
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
Basic Security: Java vs.NET Master Seminar Advanced Software Engineering Topics Prof. Jacques Pasquier-Rocha Software Engineering Group Department of Informatics.
Module 3: Working with Components. Overview An Introduction to Key.NET Framework Development Technologies Creating a Simple.NET Framework Component Creating.
WebServices, GridServices and Firewalls Matthew J. Dovey Technical Manager Oxford e-Science Centre
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Session and Cookie Management in.Net Sandeep Kiran Shiva UIN:
Module 7: Creating a Microsoft ASP.NET Web Application.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
XML Web Service. Overview of XML Web Service ASP.NET XML Web services enable you to remotely access the properties and methods of classes across a network.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
Module 3: Using Microsoft.NET- Based Languages. Overview Overview of the.NET-Based Languages Comparison of the.NET-Based Languages.
1 Creating Web Services from a existing tool Presented by Ashraf Memon Hands-on Ashraf Memon, Ghulam Memon.
Integrating and Troubleshooting Citrix Access Gateway.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program Design, Second Edition Second Edition D.S. Malik D.S. Malik.
GUDURU PRAVEEN REDDY.NET IMPERSONATION. Contents Introduction Impersonation Enabled Impersonation Disabled Impersonation Class Libraries Impersonation.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Introduction to Applets Chapter 21. Applets An applet is a Java application that is intended to be invoked and executed through a Web browser. Click Here.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
Exception. Agenda Exception. Handling Exceptions. The finally Clause.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Design issues for Object-Oriented Languages
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Metropolia 2013 C# programming and .NET framework
Implementing TMG Server Publishing
Introduction to C# AKEEL AHMED.
Module 10: Creating a Web Application with Web Forms
Student: Popa Andrei-Sebastian
Jim Fawcett CSE681 – SW Modeling & Analysis Fall 2018
Presentation transcript:

PCT403 – SharePoint and WSS: Allowing Your Code to Work with Both Eugene Rosenfeld Black Blade Associates

Overview This session will focus on creating applications, web parts, and server controls that function in both a portal, WSS within portal, and WSS only environments. Topics will include Distinguishing between portal areas and WSS sites The use of reflection to dynamically load portal- specific assemblies when present Correctly handling the differing security models of the three scenarios. Application elements such as site navigation will be specifically targeted.

The Similarities Sites Lists Libraries

The Differences Object types Portal has many more object types than WSS Navigation Sub Areas vs. Sub Sites Area hierarchy is virtualized; sites hierarchy is physical Hidden Areas Explicit order vs. Alphabetical order Container Sites Sites Directory Security Sites support list level security; areas do not Audiences for web parts Portal Listings Portal Assemblies

Programming Frameworks SharePoint object model SharePoint web services Regardless of which framework we are using, we need to answer: Is the code accessing a server with SPS or just WSS? Is the site the code is accessing a site or an area?

SharePoint object model Distinguishing between portal areas and WSS sites Early binding to both WSS and SPS assemblies but detecting assembly load errors on SPS assembly Early binding to both WSS but late binding to SPS assemblies Using conditional compilation to create separate WSS and SPS version of the assembly

Assemblies – Early Binding Conditional compilation directives Pros: Compile time error checking Cons: Two different version of each assembly More complex deployment – deploy correct assembly for correct environment May need to deploy different assembly if environment changes More testing Code must run from a server in the farm Can only work against one server farm at a time

Early Binding - Code private void button1_Click(object sender, System.EventArgs e) { System.Reflection.Assembly asmWSS; try { //try to load the assembly asmWSS = System.Reflection.Assembly.Load("Microsoft.SharePoint, Version= , Culture=neutral, PublicKeyToken=71e9bce111e9429c"); } catch(Exception ex) { //the assembly could not load. we assume there is no WSS on this computer asmWSS = null; System.Diagnostics.Trace.WriteLine("Error detected: " + ex.Message + "\r\n" + ex.StackTrace, ex.GetType().Name); } if(asmWSS != null) UseWSS(); } private void UseWSS() { //we have a strong reference to an SPSite object Microsoft.SharePoint.SPSite site = new Microsoft.SharePoint.SPSite(" MessageBox.Show(site.GetType().Name.ToString(), "SPSite object created"); }

Assemblies – Late Binding Late Binding Through Reflection Pros: Single assembly for WSS or Portal Cons: Minimal compile time error checking More code to manage Code must run from a server in the farm Can only work against one server farm at a time

Late Binding - Code System.Reflection.Assembly asmWSS; try { //try to load the assembly asmWSS = System.Reflection.Assembly.Load("Microsoft.SharePoint, Version= , Culture=neutral, PublicKeyToken=71e9bce111e9429c"); } catch(Exception ex) { //the assembly could not load. we assume there is no WSS on this computer asmWSS = null; System.Diagnostics.Trace.WriteLine("Error detected: " + ex.Message + "\r\n" + ex.StackTrace, ex.GetType().Name); } if(asmWSS != null) { //the assembly has loaded //get a late bound reference to the SPSite type Type typSPSite = asmWSS.GetType("Microsoft.SharePoint.SPSite"); //get a reference to the constructor for SPSite that has this signature: // new Microsoft.SharePoint.SPSite(" // and invoke the constructor object objSPSite = typSPSite.GetConstructor(new Type[]{ typeof(string) }).Invoke(new object[]{ " }); //we now have a late bound object reference to a SPSite object MessageBox.Show(objSPSite.GetType().Name.ToString(), "SPSite object created"); }

Unified Web Services Pros: Easily decide if connecting to Portal or WSS Connect to remote server farms from any client Cons: May not work properly when using client PKI certificates for authentication

Unified Web Services – Code // set up the web service calls SiteDataWS.SiteData siteDataWS = new WindowsApplication1.SiteDataWS.SiteData(); siteDataWS.Url = this.txtURL.Text + (this.txtURL.Text.EndsWith("/") ? "" : "/") + "_vti_bin/sitedata.asmx"; siteDataWS.Credentials = System.Net.CredentialCache.DefaultCredentials; siteDataWS.PreAuthenticate = true; AreaWS.AreaService areaWS = new AreaWS.AreaService(); areaWS.Url = this.txtURL.Text + (this.txtURL.Text.EndsWith("/") ? "" : "/") + "_vti_bin/areaservice.asmx"; areaWS.Credentials = System.Net.CredentialCache.DefaultCredentials; areaWS.PreAuthenticate = true; // set up the returns for the web methods SiteDataWS._sWebMetadata sWebMetadata; SiteDataWS._sWebWithTime[] sWebWithTime; SiteDataWS._sListWithTime[] sListWithTime; SiteDataWS._sFPUrl[] sFPUrl; string strRoles; string[] strvRoleUsers; string[] strvRoleGroups; // get the web meta data information for the site uint intRet = siteDataWS.GetWeb(out sWebMetadata, out sWebWithTime, out sListWithTime, out sFPUrl, out strRoles, out strvRoleUsers, out strvRoleGroups); AreaWS.AreaData adArea; try { // get the area information for the web id adArea = areaWS.GetAreaData(new Guid(sWebMetadata.WebID)); } catch { // we were unable to execute the area service. assume WSS only MessageBox.Show(this.txtURL.Text + " is a site. The server has WSS, not SPS."); return; } if(adArea.WebUrl == null) // a null web url means the web id does not correspond to an area MessageBox.Show(this.txtURL.Text + " is a site. The server has both WSS and SPS"); else // a valid web url means the web id does correspond to an area MessageBox.Show(this.txtURL.Text + " is an area.");

Questions Eugene Rosenfeld Black Blade Associates