Microsoft SharePoint 2003 (WSS and SPS) is the first version of SharePoint to show the power of an application programming interface (API) based on the Microsoft DotNet Framework. Solving problems that can satisfy customers' development has always been a hot issue for the programming world. However, custom-made developments in the 2003 version have caused some issues that are not really satisfactory for the technical community. The truth is, there is no significant method for flexible software deployment in SharePoint 2003. Development experts encounter two time-consuming problems: 'copy and paste' instructions for with all custom files and combine them, or build a new installer to solve this problem.
Microsoft Office SharePoint Server 2007 is an integrated solution for servers, allowing for improved organization effectiveness by providing enhanced content management, business search, and increased productivity. shared process in the enterprise, facilitating the sharing of information within the enterprise to improve the understanding of the work.
Office SharePoint Server 2007 supports all internal networks, extended networks, and web applications that operate in an integrated platform instead of relying on separate systems.In addition, this content management and collaboration also provides professionals and developers with a platform and tools needed for system administration, extended applications, and interoperability. part.
The SPS 2003 product has a number of changes when they are released, including new templates, one of which includes several files: combined to install the IIS or in the Global Assembly Cache directory (GAC); custom aspx pages; event management; web controls and services; WebParts. WebParts is just a component of setting up installation procedures (using the ' stsadm ' tool, SharePoint command line management tool); however, if WebPart needs to be installed within a template, this useful deployment procedure becomes very complicated.
Creating deployment tools for multiple purposes is a common way. With simple applications, this is done well; however, difficulties arise when writing multiple codes in a project. In this case, development teams can take great advantage of development resources, debugging, and extended software.
Other next-generation problems with a long-term deployment system are the lack of a schema throughout the version, the inability to restore information or revert to the previous deployment solution in an easy and appropriate way. , the difficulty of installing all the components in the server system in a unique way (deploying the repetitive needs in each server independent of this server system). Similarly, individual responses are also required to make changes in the web configuration file to ensure the registration of components and configuration for the Computer Access Security (CAS) computer access security policy.
SharePoint 2007 solutions: Resolve outstanding problems
The latest version of SharePoint, Windows SharePoint Services (WSS 2007) and Microsoft Office SharePoint Server (MOSS 2007) provide a solution to deployment issues that are available in SharePoint Solutions.
SharePoint Solutions is a platform that gathers all the components needed to create a customer request in a Solution file. The framework allows installation, activation, deactivation and disassembly operations that are still used by system administrators, without their troubles in technical issues related to physical location. file and manipulate them.
SharePoint Solutions provides:
In essence of the problem, a Solution .cab file contains all the files installed as the "manifest.xml" file. This manifest file is a file that instructs the solution engine to define its task, the physical location to install certain files, and some data needed for its registration in SharePoint. Solution's file extension is '.wsp' and if it changes to '.cab' it can open the file and check its contents.
As a corporate strategy, Microsoft is distributing the latest SharePoint software; 'Windows SharePoint Services 3.0 Application Templates: Server Admin Templates "using the main application" Application Template Core "installs an administrator tool for tempalates, which are then installed as a Solution. Additional features, all components are distributed equally as Solutions.
Use Solution from the user interface and stsadm
To install a Solution, use the " stsadm " SharePoint administration tool with the following command:
STSADM.EXE -o addsolution -filename
For example, to install the related application in the above section for tempalate: "C: Program FilesCommon FilesMicrosoft Shared web server extensions12BINSTSADM.EXE" -o addsolution -filename C: ApplicationTemplateCore.wsp (if the .wsp file is in the file location root of the system)
After installation, the Solution is uploaded to configure the database data (the configuration database object table), but this form is not used in the system; It still needs to be activated. From the next point, the management of Solution can be done from the Central Administration Web interface of SharePoint. Go to the Central Administration , the " Operations " tab, under " Solution management " (the " Global configuration " section) is a list of all the installation solutions with its status and the Web Application (s) used.
Figure 1 : Solution Management in the Central Administration of SharePoint
When the desired Solution is selected, the next screen will show you the Solutions and buttons including; one to deploy solutions and one to remove them. The second button will reverse the installation procedure and will finish the installation process first.
Figure 2 : Window to deploy and remove a Solution
The deployment can be completed immediately or at some time in the future. Solution Framework can initiate a scheduled task; That way, you can deploy Solution when the system administrator considers it appropriate.
Metadata in the Solution definition or in each component specifies the scope of deployment of the server system. The example shown in Figure 3 shows us a full deployment and because there are many small components used in GAC, the window displays an alert.
Figure 3 : Central Administration deployment screen
The implementation of the 'stsadm' tool is implemented by the following syntax:
STSADM.EXE -o deploysolution -name [-url] [-allcontenturls] [-time ] [-immediate] [-local] [-allowgacdeployment] [-allowcaspolicies] [-lcid] [-force]
Note : The parameters between '[]' are optional.
Determining the Solution is entirely possible if the Solution is deployed with the same solution ID of an existing solution in the repository. In this case, the original solution is removed from the repository, backed up and stored in the configuration repository and a new solution is added. Backup is used until failure to install and only a backup is saved for a Solution.
After deployment, the solution can be disabled or removed by the following procedure, executed from the Central Administration's user interface or by 'stsadm' with the following syntax:
STSADM.EXE -o retractsolution .name [-url] [-allcontenturls] [-time ] [-immediate] [-local] [-lcid]
The list of "deploysolution- deployment" and "retractsolution" parameters, "stsadm" allows for better control over the Web user interface. However, the drawback here is that the command line tool is less friendly. with users.
To delete a Solution from the server system, simply do the following:
STSADM.EXE -o deletesolution -name
[-override] [-lcid]
Use programming
SharePoint user interface and 'stsadm' are not just for installing and activating solutions. SharePoint object model provides classes and methods to perform task programming capabilities.
SPSolution and SPSolutionCollection classes present a corresponding solution and collection of solutions in SharePoint server systems. SPSolutionLanguagePack and SPSolutionLanguagePackCollection classes have the same structure but are used specifically for managing Language Pack language packs. There are three special components: SPSolutionDeploymentJobType, SPSolutionDeploymentState and SPSolutionOperationResult, used to define the types, states, and possible effects of the solution.
All these classes and special components are in Microsoft.SharePoint.Administration NameSpace in Microsoft.SharePoint.dll. Each special component of the classes, methods, and properties is referenced by the SDK from WSS 2007 (SPSolution Class and SPSolutionCollection Class).
To list their solutions and properties in the server system, do the following:
1. SPSolutionCollection mySolutionColl = SPFarm.Local.Solutions; 2. foreach (SPSolution mySolution in mySolutionColl) 3. {4. Console.WriteLine ("Name -" + mySolution.DisplayName + 5. ", Deployed -" + mySolution.Deployed.ToString () + 6. mySolution.DeploymentState.ToString () + 7. ", Status -" + mySolution.Status.ToString ()); 8. } 8. }
The first command line demonstrates that an object has been created with a number of solutions in the server system. The 'foreach' command iterates through each Solution to illustrate its properties. There are many properties and methods to control Solution's potential including: CAS policies; resources or collections installed in the GAC; a check to detect whether a Solution has been deployed; there will be a signal flag if a task is deployed; its state .
To install a new Solution in the Solutions Store repository, use the following code:
9. SPSolution mySolution = SPFarm.Local.Solutions.Add (@ "C: HelpDesk.wsp");
10. Console.WriteLine ("Solution" + mySolution +
11. "installed:" + mySolution.Added.ToString () +
12. ", deployed:" + mySolution.Deployed.ToString
The 'Add' method uses 3 structures that allow installing a solution; Use a previously created SPSolution object; use the path to the .wsp file; and the third is the .wsp path and language verification. The return value is a SPSolution object.
To deploy Solution, the code with the object model is:
13. SPSolution mySolution = SPFarm.Local.Solutions ["HelpDesk.wsp"]; 14. Console.WriteLine ("Before: DeploymentState -" + mySolution.DeploymentState.ToString ()); 15. mySolution.Deploy (DateTime.Now, false, false); 16. Console.WriteLine ("After: DeploymentState -" + mySolution.DeploymentState.ToString ());
Note that, if no object has a reference to the Solution, as shown in line 13, it is possible to create a new object. The Deploy method has two constructs: one to deploy the Solution to all Web applications in the server system and allow the user to choose which web application to be deployed. In fact, this method is not correct in the sense of Solution but it creates a SharePoint task to perform the deployment. Therefore the second message of the Console.WriteLine control panel will always instruct "NotDeployed" (not implemented): a confirmation that there is a period of time between executing the code and the time of the work machine. initialize the task.
The first parameter of the 'Deploy' method indicates when the action is started. The "globalInstallWPPAckDll" parameter (the second parameter in the example) is used exclusively for deploying WebParts and allows the installation of WebPart components in the GAC. The third parameter is a parameter 'required' force (binary); If this parameter has the value of 'false' then the Solution has been implemented, the procedure will give an exception.
If the Web interface of the Central Administration (Figure 2) is used, the Solution containing components deployed in the GAC will display an alert. If the 'stsadm' administration tool is selected, it is actually using the "-allowgacdeployment" flag sign to deploy GAC. If the object model is chosen to deploy Solution, no warning will be issued.
If you need to execute 'iisreset' to restart the ISS applications, you must program them independently or manually because the 'Deploy' method does not perform this task automatically.
Upgrading Solution can be done using SPSolution: Upgrade (System.String) method if Solution is still not implemented and SPSolution.Upgrade (System.String, System.DateTime) method if it has been implemented .
Finally, to remove or disable Solution, the appropriate methods of the SPSolution class applied are:
17. SPSolution mySolution = SPFarm.Local.Solutions ["HelpDesk.wsp"];
18. mySolution.Retract (DateTime.Now);
19. mySolution.Delete ();
Line 18 has the effect of disabling a deployed Solution. This method may have a parameter (deactivated task start date and time) or two parameters (the time of the job and a reference to the web application, where Solution has been deployed). Line 19 has the simple effect of removing a Solution from the server system.
It should be noted that deploying the object model to install, activate, and disable Solutions will have some inherent risks. The timing of the work machine may be substantially slower than that of a Web application, which is implementing object model code. Care must be taken with respect to the use of event sequences: always wait until a process is completed before initializing the next process; otherwise, the solution engine can generate errors, one of which may eventually appear. Solution will be in 'hold' to prevent further steps.
Conclude
SharePoint Solutions is a perfect option to deploy client requests in SharePoint 2007, which is a solution to improve the problems that appear for SharePoint 2003. It has many different complementary solutions; Apply SharePoint administration tools, use Web interface or programming activities. Next article, I will show you how to create Solutions, explain the various components of the schema and discuss aspects related to the structure of the .wsp file.