Moss field editing permission control solution (4)-packaging Solution

Source: Internet
Author: User
Through the above articles, we understand the things that need to be developed for the entire solution:
There is a configuration page: fieldeditcontrol. aspx, we need to put it in the 12 \ template \ layouts \ codeart folder.
There is a feature: codeart_fieldeditcontrol. The file needs to be placed in 12 \ template \ Features \ codeart_fieldeditcontrol and installed in farm.
There is a DLL: codeart. Sharepoint. dll, which is the core of the entire solution Code To avoid permission issues, register the DLL to GAC or copy it to the bin directory of the site.
There is a template file: codeart_templates.ascx, which needs to be placed in the 12 \ template \ controltemplates directory.
You must manually modify the Web. config file of each site and add safecontrol: < Safecontrol Assembly = "Codeart. Sharepoint, version = 1.0.0.0, culture = neutral, publickeytoken = 2c606279787b575f"
Namespace = "Codeart. SharePoint" Typename = "*" Safe = "True"   />

The above deployment can be implemented by hand + cmd, and manual deployment will have the following problems:
1) Please copy Several folders. One server is fine. If farm has two or three front-ends, it is absolutely fatal.
2) Other... Not expected

Happily, WSS provides the standard deployment method: WSP solution package. With WSP, We can package all the deployment files, add the deployment files to farm, and manage them using the solution from the management center.
Function to deploy WSP to all front-end servers.

The following is translated from SDK:

The solution package is a cab file (. Cab) with. WSP as the filename suffix. It can contain the following components:

    • Site Definition

    • Feature Definition and corresponding files

    • Web part definition file (*. webpart, *. DWP)

    • The template file and the files in the 12 directory contain the following types:

      • Application page in the _ layouts directory.

      • Language Resource file (*. resx)

      • Other files (for example, *. doc or *. xls)

    • ApplicationProgramSet (DLL), including:

      • Safe Control entries

      • Resources

    • The Code accesses the security policy file.

Manual WSP file creation requires manifest. xml list. The DDF file of makecab is cumbersome. vs extension for wss3 released by Microsoft does not provide a convenient packaging method.
Fortunately, a guy on the Internet wrote a packaging tool wspbuilder, which solved our troubles.
See: http://www.codeplex.com/wspbuilder

The basic usage of wspbuilder is to place the files to be deployed completely in accordance with the structure of the 12 directory, to deploy the DLL to the GAC directory, and then use the command line to call Wspbuilder-solutionpath ../-outputpath output-wspname codeart_fieldrightsolution (V1.0). WSP

The following is a project example:

This is a basic "perfect" WSS (MOSS) project development structure. When you need to deploy it, double-click build. CMD, generate a solution in the output directory, and use install. CMD is deployed to farm.
In the subsequent development process, if we are still bored with the use of WSP to deploy and test each time, we can use the Command Script file to update it:

To update the DLL, double-click the GAC. CMD file. If you modify the resource file (the file in the 12 directory), double-click deployresources. CMD to copy the file.
To debug the code, follow these steps: compile the project and run GAC. CMD (update DLL, automatically restart apppool), refresh the page, and append w3wp. EXT process, breakpoint setting, Development and debugging.
See: Use the CMD command to accelerate Moss Development
The script file needs to be modified according to the actual situation of the project, such as modifying the name of the application pool and modifying the site URL to be deployed.

Script File Content:

Build. cmd
If exist output \ codeart_fieldrightsolution (V1.0). WSP del output \ codeart_fieldrightsolution (V1.0). WSP
Wspbuilder-solutionpath ../-outputpath output-wspname codeart_fieldrightsolution (V1.0). WSP
Pause


Install. cmd
@ Echo off

@ Set stsadm = "C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ bin \ stsadm"

Set site_url = "http: // localhost: 81"

Set solution_name = codeart_fieldrightsolution (V1.0). WSP

Rem ----- deactivate the feature (s )-----
REM % stsadm %-O deactivatefeature-name featurename-URL % site_url %-Force

Rem ----- remove the features and solution -----
% Stsadm %-O retractsolution-name % solution_name %-immediate-URL % site_url %

Echo.
Echo.
Echo success -------------------------------------------------------------------------------------------
Echo verify that the correct solutions have been completly retracted and then press ENTER
Echo success -------------------------------------------------------------------------------------------
Echo.

% Stsadm %-O execadmsvcjobs

Echo on

Rem ----- Delete the solution -----
% Stsadm %-O deletesolution-name % solution_name %

Rem ----- add and depoly the solution -----
% Stsadm %-O addsolution-filename % solution_name %
% Stsadm %-O deploysolution-N % solution_name %-immediate-allowgacdeployment-allowcaspolicies-URL % site_url %

Echo off
Echo.
Echo.
Echo success -------------------------------------------------------------------------------------------
Echo solution deployment complete, press enter to activate features, if any
Echo success -------------------------------------------------------------------------------------------

% Stsadm %-O execadmsvcjobs

Echo on
Rem ----- active features -----
REM % stsadm %-O activatefeature-name featurename-URL % site_url %-Force

Rem ----- remove the following comment if features are present
Rem pause


GAC. cmd
Echo adding assemblies to the GAC...
"% ProgramFiles % \ Microsoft Visual Studio 8 \ SDK \ V2.0 \ bin \ gacutil.exe"-If bin \ debug \ codeart. Sharepoint. dll
Rem -- iisreset
Iisapp/a "SharePoint-81"/R


Deployresources. cmd
::
: Codeart deployment script, copy all files to 12.
::

Xcopy/S/y/C/R "12" "% ProgramFiles % \ common files \ microsoft shared \ Web Server Extensions \ 12 \"

@ Echo off
Echo.
Echo.
Echo copy resource files complete! Press any key to quit.
Echo.
Echo.

Pause

This seriesArticleAfter writing it, it is a purpose to introduce the implementation of a solution, but more importantly, I hope you can learn some ideas and convenient methods for WSS (MOSS) development.

In addition:
There are other free packaging tools on the Internet, but I personally think wspbuilder is easy to use.

The group control function has been added and basic tests have been conducted:
Http://files.cnblogs.com/jianyi0115/CodeArt_FieldRightSolution.zip

all articles in this series:
codeart wss3.0 (MOSS) Field editing permission control solution (V1.0)
codeart wss3.0 (MOSS) implementation of field editing permission control solution-Overview
Implementation of moss field editing permission control solution (1) -Management page development and configuration information persistence
WSS page customization series (2) --- custom form pages for a single list
WSS page customization series (3) --- rewrite the Save logic of the form
moss field editing permission control solution (4)-packaging solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.