MOSS开发经验收集

来源:互联网 发布:pc淘宝神笔使用教 编辑:程序博客网 时间:2024/04/29 21:52

 

(1)
问题:
访问http://hcsserver:9001/时候,页面出现错误为:

返回网站
错误

此网页存在致命错误。如果问题持续存在,请与系统管理员联系。
Windows SharePoint Services 疑难解答。

原因:
在C:/Inetpub/wwwroot/wss/VirtualDirectories/9001中的web.config文件的内容
<SafeControls>
  <SafeControl ~~~~~~/>
</SafeControls>
被修改的不正确,比如Safe写成Sage或少了“,”

解决方法:
将web.config修改正确,重启IIS的相应站点和应用程序池

由此想到的:
WSS属于2次开发,这些原始代码不能直接去修改,如果修改则要有版本控制。
我的解决方安:
1.WSS的原始代码上传到TFS
2.IIS上运行的WSS代码由TFS下载得到
3.任何人对WSS源码的修改,都只能签出TFS的代码作修改,之后上传,之后再将IIS的代码作同步。

(2)
当IIS上的SharePoint - 9091站点被删除后的恢复办法:
打开SQL Server Configuration Manager-停掉SQL Server-再打开其-copy出WSS_Content数据库-删掉WSS_Content数据库打开MOSS的管理中心-应用程序管理-创建或扩展web应用程序,创建新的9091站点-将现在的WSS_Content数据库换成刚刚拷贝的数据库,可以直接替换或通过备份恢复-在MOSS的“管理中心”的“应用程序管理”的“内容数据库”中-删掉现有的WSS_Content,再添加以前的WSS_Content,一切OK,可能需要用老的文件再覆盖一下现在的文件。

(3)
Infopath表单发布成表单库时让Browser可用的注意事项:
1.网站操作-网站设置-修改所有网站设置-网站功能:激活“Office SharePoint Server 企业版网站集功能”
2.发布时勾选“Enable this form to be filled out by using a browser”

Infopath表单用作工作流的注意事项:
1.Tools-Form Options-Security and Trust,选择Domain或Full Trust后工作流才可用。如果表单用了Full Trust而双击打不开时,则右键.xsn文件选择Design。
2.Infopath表单保存的文件名和发布的文件名应该一致,因为MOSS用的是发布后的文件而ID内的某段单词是保存的文件名。
3.如果使用了Contact Selector控件,则在数据源里要加组Person和域DispalyName、AccountId、AccountType,注意组名和域名必须写的正确且区分大小写,还要加名为Context.xml的文件其内容为<Context siteUrl="http://myserver/">。此规定可在Contact Selector Properties里的Items里找到。


手动配置MOSS工作流:
1.右键工程文件-Properties-“Build Events”->“Post-build event command line”改变“NODEPLOY”到“DEPLOY”
2.右键工程文件-Properties-“Signing”-勾选“Sign the assembly”-选下拉菜单的“New”,不要加密码。
3.配置feature.xml:
Id的获得VS2005-Tools-Create GUID,选4.Registry Formagt,点击Copy-黏贴到feature.xml文件的Id处。
有可能需要删掉或修改feature.xml内的<ElementFile Location="MyForm.xsn"/>
其中“Title”,“Description”可以修改。<Property Key="RegisterForms" Value="*.xsn" />用于注册Infopath表单。

4.配置workflow.xml:
“Name”,“Description”可修改。
“Id”,“CodeBesideClass”,“CodeBesideAssembly”必须修改。
获得.dll文件的公钥标记的方法C:/Program Files/Microsoft Visual Studio 8/VC>sn -T "C:/Documents and Settings/jqli.HSLCN/Desktop/MOSS/SequentialWorkflow/SequentialWorkflow/bin/Debug/SequentialWorkflow.dll"
ModificationUrl="_layouts/ModWrkflIP.aspx"依照情况删掉。
<Association_FormURN>associationFormURN</Association_FormURN>,<Instantiation_FormURN>instantiationFormURN</Instantiation_FormURN>,<Task0_FormURN>taskFormURN</Task0_FormURN>需修改。
如果想增加一个Task表单则添加<Task1_FormURN>并且在代码中用createTask1_TaskProperties1.TaskType = 1;指定任务与表单的关系。
依照情况删除<Modification_GUID_FormURN>modificationURN</Modification_GUID_FormURN>和<Modification_GUID_Name>Name of Modification</Modification_GUID_Name>
URN的获得-打开Infopath表单-转到编辑状态(Tools-Design This Form)-在设计窗口中点击File-Properties-拷贝ID里的文本内容。

5.拷贝所有用到的Infopath表单到项目文件的~/DeploymentFiles/FeatureFiles内。

6.自动发布工作流到MOSS则修改PostBuildActions.bat文件内的所有http://localhost为正确的地址后,Build一下工程文件则工作流发布成功。也可以手动发布,如下。

手动安装MOSS工作流:
1.拷贝dll文件到GAC中,在C:/WINDOWS/assembly里面或Start-Administrative Tools-Microsoft .Net Framework 2.0 Configuration
2.拷贝项目文件的~/DeploymentFiles/FeatureFiles内的配置文件和表单文件到C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/FEATURES/内。
3.可以先验证一下表单,执行C:/Program Files/Microsoft Visual Studio 8/VC>"C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/BIN/STSADM.EXE" -o verifyformtemplate -filename  "C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/
TEMPLATE/FEATURES/SequentialWorkflow/testTmpl.xsn"
再执行
C:/Program Files/Microsoft Visual Studio 8/VC>"C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/BIN/STSADM.EXE" -o installfeature  -filename "SequentialWorkflow/feature.xml" -force
再执行
C:/Program Files/Microsoft Visual Studio 8/VC>"C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/BIN/STSADM.EXE" -o activatefeature -filename "SequentialWorkflow/feature.xml" -url http://localhost:9091
4.此时“网站设置>网站功能”内能看到工作流且已激活。“Central Administration > Application Management > Manage Form Templates”内能看到Infopath表单且Status为Ready,Workflow Enabled为yes
5.执行iisreset
6.显示工作流表单时,如果出现以下问题:“The form cannot be displayed because the session state is not available”或“该表单无法显示,因为会话状态不可用”
解决方法:在网站的web.config中的httpmodules一节增加<add name="Session" type="System.Web.SessionState.SessionStateModule"/>


手动卸载MOSS工作流:
1.停用“~>网站设置>网站功能”内的相应工作流
可先执行C:/Program Files/Microsoft Visual Studio 8/VC>"C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/BIN/STSADM.EXE" -o deactivatefeature -filename "SequentialWorkflow/feature.xml" -url http://localhost:9091
再执行
C:/Program Files/Microsoft Visual Studio 8/VC>"C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/BIN/STSADM.EXE" -o uninstallfeature  -filename "SequentialWorkflow/feature.xml"
2.此时“Central Administration>Application Management>Manage Form Templates”内的Infopath模版也已经卸载掉。
3.卸载“C:/WINDOWS/assembly”内的dll
4.删除“C:/Program Files/Common Files/Microsoft Shared/web server extensions/12/TEMPLATE/FEATURES/”内的相应文件。

(4)
WebPart开发:
1.要在WebPart工程的AssemblyInfo.cs文件中添加“[assembly: System.Security.AllowPartiallyTrustedCallers()]”,以便在MOSS中能正确使用此WebPart。
把WebPart编译后的.dll文件放到C:/Inetpub/wwwroot/wss/VirtualDirectories/9091/bin里面或放到GAC即C:/WINDOWS/assembly里面。

2.把UserControl的.ascx文件可放到任意地方如C:/Inetpub/wwwroot/wss/VirtualDirectories/9091/bin,如果UserControl的C#的代码没有放到.ascx文件里,而是采用的后置代码形式,则应该将编译后的UserControl的.dll文件也放到MOSS站点中。

如果UserControl建立在ASP.NET Web Site工程里,则通过右键工程选“Publish Web Site”-勾选“Allow this precomplied site to be updatable”和“Use fixed naming and single page assemblies”-点“OK”,将发布得到的.dll文件放到C:/Inetpub/wwwroot/wss/VirtualDirectories/9091/_app_bin里面。.ascx文件可放到任意地方。

如果UserControl建立在ASP.NET Web Application工程里,则通过编译工程后在Bin目录中得到的.dll文件,将其放到C:/Inetpub/wwwroot/wss/VirtualDirectories/9091/bin里面。.ascx文件可放到任意地方。

3.为了添加WebPart到MOSS站点,在C:/Inetpub/wwwroot/wss/VirtualDirectories/9091中的web.config文件中的<SafeControls>里面添加一句<SafeControl Assembly="HRManagementWP" Namespace="HRManagementWP" TypeName="*" Safe="True" />

为了使MOSS有权限访问C:/Inetpub/wwwroot/wss/VirtualDirectories/9091/bin目录中的UserControl的.dll等文件,把<trust level="WSS_Minimal" originUrl="" />修改为<trust level="Full" originUrl="" />



(5)
Microsoft® Visual Studio® 2005 Team Suite Service Pack 1
在开始SP1更新前,假如你在你系统上安装了那个单独的VS 2005 Web应用项目的话,确认你将它卸载了。你不再需要它了,因为它的支持是内置于SP1中的,假如你安装了它的话,SP1安装程序会停止,让你将它卸载了才会继续下去。你现有的web应用项目文件还会继续工作,所以你对它们不需要做什么更新。
http://www.microsoft.com/downloads/details.aspx?FamilyId=BB4A75AB-E2D4-4C96-B39D-37BAF6B5B1DC&displaylang=en
安装vs05 sp1时遇到“Error 1718. File was rejected by digital signature policy”错误的解决办法:
http://support.microsoft.com/kb/925336/zh-cn


Visual Studio 2005 Web 应用程序项目
http://msdn2.microsoft.com/zh-cn/asp.net/Aa336618.aspx
为了在 Visual Studio 2005 中完全启用 Web 应用程序项目,必须首先安装 Microsoft Visual Studio 2005 – 更新到支持 Web 应用程序项目(Microsoft Visual Studio 2005 - Update to Support Web Application Projects),然后再安装此外接程序。

Microsoft Visual Studio 2005 - Update to Support Web Application Projects
http://www.microsoft.com/downloads/details.aspx?familyid=8B05EE00-9554-4733-8725-3CA89DD9BFCA&displaylang=en



Windows SharePoint Services 3.0
http://www.microsoft.com/downloads/details.aspx?FamilyId=D51730B5-48FC-4CA2-B454-8DC2CAF93951&displaylang=en

Windows SharePoint Services 3.0: Software Development Kit (SDK):
http://www.microsoft.com/downloads/details.aspx?familyid=05E0DD12-8394-402B-8936-A07FE8AFAFFD&displaylang=en


Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions:
http://www.microsoft.com/downloads/details.aspx?familyid=19f21e5e-b715-4f0c-b959-8c6dcbdc1057&displaylang=en

Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation):
http://www.microsoft.com/downloads/details.aspx?familyid=5D61409E-1FA3-48CF-8023-E8F38E709BA6&displaylang=en

SharePoint Server 2007 SDK: Software Development Kit
http://www.microsoft.com/downloads/details.aspx?familyid=6d94e307-67d9-41ac-b2d6-0074d6286fa9&displaylang=en


Microsoft? Windows? Workflow Foundation Runtime Components Beta 2.2 and Visual Studio? 2005 Extensions for Windows Workflow Foundation Beta 2.2:
http://www.microsoft.com/downloads/details.aspx?familyid=5c080096-f3a0-4ce4-8830-1489d0215877&displaylang=en#filelist

2007 Office System Starter Kit: Enterprise Content Management Starter Kit:
http://www.microsoft.com/downloads/details.aspx?FamilyID=38ca6b32-44be-4489-8526-f09c57cd13a5&displaylang=en

Windows SharePoint Services 3.0 Starter Kit: Workflow Developer Starter Kit for Windows SharePoint Services 3.0:
http://www.microsoft.com/downloads/details.aspx?familyid=5DDF902D-95B1-4640-B9E4-45440DC388D9&displaylang=en

Windows SharePoint Services 3.0 Application Templates: All Templates
http://www.microsoft.com/downloads/details.aspx?familyid=5807b5ef-57a1-47cb-8666-78c1363f127d&displaylang=en&tm

Application Templates for Windows SharePoint Services 3.0
http://www.microsoft.com/technet/windowsserver/sharepoint/wssapps/templates/default.mspx

SharePoint Products and Technologies Templates: Web Part Templates for Visual Studio .NET (好像用于VS2003):
http://www.microsoft.com/downloads/details.aspx?FamilyID=cac3e0d2-bec1-494c-a74e-75936b88e3b5&DisplayLang=en



海洋工作室:
http://www.oceanstudio.net/default.aspx
海洋邮箱:
v-haiju@microsoft.com

Erucy's blog
http://blog.joycode.com/erucy/  

陈老师博客:
http://blog.joycode.com/choral/  

11大哥博客:
http://sps.dnngo.com/Blog/default.aspx

兰竹菊梅博客:
http://www.cnblogs.com/foundation/articles/515615.html

彦斌博客:
http://blog.sina.com.cn/s/blog_4925e2f901000ati.html  用loadcontrol的方式来加载webpart
http://blog.sina.com.cn/s/blog_4925e2f901000a23.html  Moss2007搜集来的资料

Andrew Connell博客:
http://www.andrewconnell.com/blog/articles/MossWcmResources.aspx#MasterPagesPageLayouts

 

Office中文官网
http://office.microsoft.com/zh-cn/2007/FX100649542052.aspx?ofcresset=1
Office英文官网
http://office.microsoft.com/en-us/FX100647101033.aspx?pid=CL100569831033

Visual Studio 2005 Tools for Office Second Edition视频教程:
http://msdn2.microsoft.com/en-us/office/aa905543.aspx

2007 Office System Video: Enterprise Content Management:
http://www.microsoft.com/downloads/details.aspx?familyid=562b9b75-55b7-4f5d-afe4-1f78c8b7fc6d&displaylang=en#filelist

如何最方便的创建SharePoint解决方案包:
http://blog.joycode.com/choral/archive/2007/06/15/104276.aspx

MOSS 解决方案包WSP:
http://www.cnblogs.com/wanghao-3/archive/2007/07/12/815563.html

一步一步SharePoint 2007:
http://www.winos.cn/forum/viewthread.php?tid=5397

SharePoint 2003安装步骤
http://www.cnblogs.com/payche/archive/2007/04/27/729653.html
http://www.cnblogs.com/applengine/archive/2006/01/19/320266.aspx
http://blog.donews.com/ynzf/archive/2006/09/27/1048182.aspx

让用户控件包装器“见鬼”去:
http://www.cnblogs.com/wanghao-3/archive/2007/08/13/853207.html

SharePoint WebPart开发实战(一):定制属性及配置界面:
http://blog.csdn.net/jackjoy/archive/2007/08/05/1727745.aspx

QuickPart:
http://www.codeplex.com/quickpart
http://blog.joycode.com/kaneboy/articles/89144.aspx

六步实现Sharepoint+QuickPart+Ajax
http://taglib.cn/story.php?title=%e5%85%ad%e6%ad%a5%e5%ae%9e%e7%8e%b0sharepointquickpartajax

UpdatePanel在Quickpart中的应用
http://jlj80.spaces.live.com/blog/cns!B14C4E651E0B0354!213.entry

SharePoint多级审批工作流开发文档[Sequential版] v1.1
http://www.cnblogs.com/xiaoshatian/archive/2007/09/03/657181.html

MOSS工作流开发+Email提醒:
http://www.cnblogs.com/wanghao-3/archive/2007/06/26/795844.html

针对开发人员的 Windows SharePoint Services V3 和 SharePoint Server 2007 工作流简介:
http://www.microsoft.com/china/MSDN/library/Office/sharepoint/ms406057.mspx?mfr=true

Office SharePoint Server2007开发入门指南
http://book.csdn.net/bookfiles/476/10047616654.shtml

Visual Studio.net 2005 新建项目对话框中项目模版消失的解决方案:
http://www.cnblogs.com/xiaoshatian/archive/2006/12/14/592464.html


MOSS工作流开发入门学习:
http://www.cnblogs.com/wanghao-3/archive/2007/06/28/799238.html
因为Windows SharePoint Services和用户通过Web浏览器通讯,所以它依靠ASP.NET显示表单。这些表单被定义为ASPX页面。一个Windows SharePoint Services的工作流可以在流程生命周期中的4个地方显示自己的表单:

n      关联:When a Windows SharePoint Services administrator associates a workflow template with a particular document library or list, he might be able to set options that will apply to every workflow instance created from this association. If a workflow author chooses to allow this, she must provide a form that lets the administrator specify this information.

n      初始化:: The initiator of a workflow might be allowed to specify options when he starts a running instance. In the approval scenario just described, for instance, the options included specifying the list of workflow participants and defining how long each one had to complete his or her task. If a workflow allows this, its author must provide a form to allow the initiator to set these options, as shown in step 3 of the previous diagram.

n      完成任务:Task Completion: The running workflow instance must display a form to the participants in the workflow to let them complete their task. Shown in step 6 in the previous diagram, this form is what allowed the approvers in the earlier scenario to make comments on the document and indicate their approval or rejection.

n      修改任务:Modification: Although it wasn’t shown in the scenario above, the creator of a workflow can allow it to be modified while it’s running. For example, a workflow might allow adding new participants after it’s begun executing or extending the due date for completing tasks. If this option is used, the workflow must display a form at this point to let a participant specify what changes should be made.

 

WF’s Base Activity Library provides a group of fundamental activities, as described earlier. Windows SharePoint Services also provides a set of activities designed expressly for creating Windows SharePoint Services workflows. Among the most important of these are the following:

n      OnWorkflowActivated: provides a standard starting point for a Windows SharePoint Services workflow. Among other things, this activity can accept information supplied by a Windows SharePoint Services administrator via the Association form when the workflow is associated with a document library or list. It can also accept information supplied via the Initiation form when the workflow is started. Every Windows SharePoint Services workflow must begin with this activity.

n      CreateTask: creates a task assigned to a particular user in a task list. For example, the approval workflow in the scenario described earlier used this activity to add a task to the task list used by each of the participants. This activity also has a SendEmailNotification property that, when set to true, automatically sends an email message to the person for whom this task was created.

n      OnTaskChanged: accepts information from the Task Completion form. The approval workflow in the earlier scenario used this activity to accept the input of each participant when the document was approved.

n      CompleteTask: marks a task as completed.

n      DeleteTask: removes a task from a task list.

n      OnWorkflowModified: accepts information from the Modification form, which can then be used to change how this instance of the workflow behaves. If the workflow’s creator chooses not to include any instances of this activity in the workflow, that workflow cannot be modified while it’s running.

n      SendEmail: sends email to a specified person or group of people.

n      LogToHistoryList: writes information about the workflow’s execution to a history list. The information in this list is used to let users see where a workflow is in its execution, look at the workflow’s history after it’s completed, and more. To allow this kind of monitoring, the workflow’s author must write information to a History list at appropriate points in the workflow’s execution. Because it provides its own mechanism for tracking workflows, Windows SharePoint Services doesn’t support WF’s standard tracking service.

A typical pattern for a simple Windows SharePoint Services workflow begins with an OnWorkflowActivated activity, then uses a CreateTask activity to assign a task to a participant in the workflow. The BAL’s standard While activity might then be used to wait until the user completes the task. To learn when this has happened (perhaps the user makes multiple changes to the task, then checks a box on the Task Completion form when she’s done), an OnTaskChanged activity executes within the While, extracting whatever information the user has entered on that form. When the user has completed the task, a CompleteTask activity might execute, followed by a DeleteTask. The workflow can then go on to the next participant, using CreateTask to assign a task to him, and so on. And of course, other things can occur, such as sending email, logging information to the history list, or even including the BAL’s Code activity, which allows running arbitrary code.

 

(5)
40 Template Install:
*********************************************************

APPLICATION TEMPLATES FOR WINDOWS SHAREPOINT SERVICES 3.0

*********************************************************


=========================================================

To install the Application Template Core solution:
=========================================================

C:/Documents and Settings/jqli.HSLCN>"C:/Program Files/Common Files/Microsoft Sh
ared/web server extensions/12/BIN/STSADM.EXE" -o addsolution -filename "C:/Docum
ents and Settings/jqli.HSLCN/Desktop/New Folder/ApplicationTemplateCore.wsp"

Operation completed successfully.


C:/Documents and Settings/jqli.HSLCN>"C:/Program Files/Common Files/Microsoft Sh
ared/web server extensions/12/BIN/STSADM.EXE" -o deploysolution -name "Applicati
onTemplateCore.wsp" -allowgacdeployment -immediate

Timer job successfully created.

Please specify either '-immediate' or '-local' or '-time' parameter.

C:/Documents and Settings/jqli.HSLCN>"C:/Program Files/Common Files/Microsoft Sh
ared/web server extensions/12/BIN/STSADM.EXE" -o copyappbincontent

=========================================================

To install an Application Template:
=========================================================

C:/Documents and Settings/jqli.HSLCN>"C:/Program Files/Common Files/Microsoft Sh
ared/web server extensions/12/BIN/STSADM.EXE" -o addsolution -filename "C:/Docum
ents and Settings/jqli.HSLCN/Desktop/New Folder/RoomEquipmentReservations.wsp"

Operation completed successfully.


C:/Documents and Settings/jqli.HSLCN>"C:/Program Files/Common Files/Microsoft Sh
ared/web server extensions/12/BIN/STSADM.EXE" -o deploysolution -name "RoomEquip
mentReservations.wsp" -allowgacdeployment -immediate

Timer job successfully created.


=========================================================

Instructions for use:
=========================================================

1. Log into your SharePoint site as the site
   Administrator.
2. From the Site Actions drop-down menu in the top right,
   select Site Settings.
3. Under the Site Administration section, select Sites
   and Workspaces.
4. Select Create to create a new site using a site
   template.
5. Complete the new SharePoint site information. In the
   Template Selection section, select the Application
   Templates tab. All deployed Application Template will
   be listed in this tab.
6. Select the template to use for this site and click
   Create.
7. A site has now been created using the application
   template.

 

*********************************************************

APPLICATION TEMPLATES FOR WINDOWS SHAREPOINT SERVICES 3.0

*********************************************************


=========================================================

To install this download:
=========================================================

4. Log into your SharePoint site as the site Administrator.
5. From the Site Actions drop-down menu in the top right,
   select Site Settings.
6. Under the Galleries section, select Site templates.
7. Select Upload to load an application template into this
   SharePoint site.
8. Browse to the <template_name>.stp file from the distribution
   and select Open. If you have several application templates
   to load into your site, you can use the Upload Multiple
   Files?option to load them all at once.

=========================================================

Instructions for use:
=========================================================

1. Log into your SharePoint site as the site Administrator.
2. From the Site Actions drop-down menu in the top right,
   select Site Settings.
3. Under the Site Administration section, select Sites and
   Workspaces.
4. Select Create to create a new site using a site template.
5. Complete the new SharePoint site information. In the
   Template Selection section, select the Custom tab. Any
   application templates that have been uploaded will be
   listed here.
6. Select the template to use for this site and click Create. 

WebPart开发: 
Anonymous Personalization Trick in Web Parts:
http://www.codeproject.com/aspnet/anonywebparts.asp

 

 

原创粉丝点击