随笔分类 -  SharePoint

摘要:IIS压缩并不是一项新技术,但对于SharePoint站点而言,IIS压缩能起到很大的作用。在IIS服务器上启用IIS压缩功能之后,在IIS服务 器把页面内容发送给浏览器之前,会在服务器上先把内容进行压缩,然后发送压缩后的数据,浏览器接收到数据后,会自动进行解压,然后显示。由于在网络上传输 的数据被压缩了,所以可以将页面内容更快的传送到浏览器,提高页面浏览速度。 虽然IIS服务器上对页面内容进行压缩会耗费一定的 CPU时间,但这对于现在主流服务器CPU而言,已经不会造成什么问题。而且这点CPU时间与节省的数据传输时间相比,实在是太划算了。每次压缩过一个页 面之后,IIS会将压缩后的文件缓存.. 阅读全文
posted @ 2011-12-23 15:58 Areas 阅读(234) 评论(0) 推荐(0)
摘要:using System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;using Microsoft.SharePoint;using System.IO;namespace StatutesPublication{ 阅读全文
posted @ 2011-12-23 15:53 Areas 阅读(269) 评论(0) 推荐(0)
摘要:我们处于IT环境急剧变化的过程中,因此大量过程需要自动化。通过使用SharePoint并在SharePoint Designer中设计一个工作流,可以简单清晰的进行变更请求的收集工作。当工作流创建好并发布到列表后,可以决定是手动启动工作流,或者当有变更请求创建时自动启动工作流。 使用自动启动工作流最大的问题在于,IT部门的每个人都可能会修改该列表,并没有相关的安全措施可以避免谁的修改不开始工作流,而谁的修改应该启动工作流。因此,大多数情况下往往会选择手动。这意味着用户必须采取下列步骤来启动工作流:1.单击上下文菜单,点击工作流菜单项2.选择变更请求流程。3.启动工作流这里需要多次点击,所以我想 阅读全文
posted @ 2011-12-06 20:18 Areas 阅读(230) 评论(0) 推荐(0)
摘要:场景:使用SharePoint的调查列表做调查问卷的时候,我们经常要设置成不允许多次答复,这样的话每个人就只能答复一次。问题:可是这样会产生一个问题,就是如果一个人第二次答复的话,那么出现的错误提示页面(如下图)不是很友好。尝试的解决方案:如果熟悉SharePoint 2010的开发的话,那么可定会想到Event Handler这个解决方案。因为在2010中,可是实现使用Event Handler实现自定义错误页面。有了这个方案,那么接下来就是一些细节性的问题了。1.首先查询当前用户是否在列表中回复过帖子;2.如果回复过,那么就跳到自定义页面。代码: public override void. 阅读全文
posted @ 2011-12-06 20:11 Areas 阅读(330) 评论(0) 推荐(0)
摘要:DON'T SET YOUR SHAREPOINT APP TO FULL TRUSTI Know You've Done ItIt happens all the time, SharePoint web applications are put in Full Trust simply because the developer can't be bothered to learn about his options, nevermind exercise them.Don't feel bad if this sounds familiar, I' 阅读全文
posted @ 2011-12-06 10:49 Areas 阅读(319) 评论(0) 推荐(0)
摘要:最近项目中用到在插入Item时绑定附件,可以上传多个附件,很快就写出来了,可是测试一侧老是有问题,经过多番折腾,终于算通过测试。SharePoint 2010上传附件需注意一下几点:判断文件是否为空,即文件内容什么都没有。判断文件的扩展名是否存在。判断文件名称是否包含特殊字符,参考http://support.microsoft.com/kb/894629判断文件扩展名称是否被禁用,在管理中心可设置。判断文件上传大小,SharePoint 2010 默认是50M。Code: 1 if (FileUpload1.PostedFile.ContentLength ==0) 2 ... 阅读全文
posted @ 2011-12-06 10:32 Areas 阅读(439) 评论(0) 推荐(0)
摘要:我们要完成如下逻辑,当我们向文档库中上传文件时,我们使用工作流进行检查,只有以.docx和.doc为扩展名的文件才可上传,否则会自动删除。1.我们使用VS2008进行开发。工作流设计如下图:IfElse活动的isValid的分支条件如下:this.fileExtension.ToLower() == "docx" || this.fileExtension.ToLower() == "doc"2.工作流中各个CodeActivity的代码如下:namespaceCaryFileInfo{publicsealedpartialclassWorkflow1: 阅读全文
posted @ 2011-12-06 10:31 Areas 阅读(216) 评论(0) 推荐(0)
摘要:SharePoint的文档库是根据数据库虚拟出来的,以HTTP形式呈现,因要创建一个页面单独实现上传功能,故对于其存储和呈现机制进行了学习和研究,不过网络上相关资料还真是很少。SharePoint个人觉得还是比较适合不需要进行复杂逻辑功能的二次开发的网站构建,即适合一般基于office组件的功能门户,能够极大提高效率。以下代码能够实现往文档库下层目录上传文件的功能,主要还是参考网络上其他文章usingSystem.IO;usingMicrosoft.SharePoint;usingSystem.Web;namespaceConsoleApplication1{classProgram{st.. 阅读全文
posted @ 2011-12-06 10:22 Areas 阅读(640) 评论(0) 推荐(0)
摘要:Sharepoint List Attachments in a Webpart : The SolutionIt's not a headache until you can do without it, but to use the sharepoint's attachment controls can be a pain in you know what. Try the solution below and save your self from same.~Adding attachment Functionality in a Web Part.//Attachm 阅读全文
posted @ 2011-12-05 11:20 Areas 阅读(376) 评论(0) 推荐(0)
摘要:How to associate a worklow to a list programmaticallyGoal of this postThis post is a good example of how to programmaticallyassociate a Workflow to a list.The workflow can be standard or designed with SharePoint Designer or Visual Studio.As a workflow is using a standard tasks listand a specific wor 阅读全文
posted @ 2011-11-30 19:47 Areas 阅读(479) 评论(0) 推荐(0)
摘要:有些情景我们需要在创建workflow的时候输入一些信息(注意:这里是创建,而不是启动)。当启动每个workflow的时候再输入一些信息。这样说可能有些抽象,举个实际例子:教导主任要找几个老师批改作业,那么就需要制定一些标准比如每道题多少分。假设一共 4 道题于是教导主任创建这个工作流的时候需要一些信息。类似这样:A 20,B 30,C 30 D 20。而每个老师接到自己的工作流实例的时候呢,就需要写上所修改卷子的分数(当然,需要参考教导主任给的标准)。所以,教导主任输入的信息是共用的,每个老师自己输入的是和所启动工作流相关的。对应到实际工作流里,教导主任和老师所输入数据的页面分别叫做 Ass 阅读全文
posted @ 2011-11-30 19:36 Areas 阅读(288) 评论(0) 推荐(1)
摘要:工作流是SharePoint很重要的一部分。我写的这篇文章是通过编程的方式启动工作流。一共分两个部分:启动无参数和有参数的工作流。参考示例:http://www.sharepointkings.com/2008/09/how-to-pass-parameters-to-workflow.html首先,通过SharePoint Designer 2010针对一个文档库设计两个工作流:NameDescriptionMyWorkflow没有参数MyInitialDataWF三个参数:YourName(string); YourAge(Int); YourDate(DateTime)首先看一下无参数工 阅读全文
posted @ 2011-11-30 18:29 Areas 阅读(303) 评论(0) 推荐(0)
摘要:string tmpFieldName= tmpSPList.Fields.Add(dic.Key, SPFieldType.Text, false); var newField = tmpSPList.Fields.GetFieldByInternalName(tmpFieldName); newField.SchemaXml = newField.SchemaXml.Replace("Text", "XAttachmentField"); newField.SetCustomProperty("SiteURL", theSiteU 阅读全文
posted @ 2011-11-29 17:42 Areas 阅读(199) 评论(0) 推荐(0)
摘要:We have one problem in work, we spend with that two days without any solution, all we found cause some another problem. This is what help us when the page is not making second postback in update panel when the first postback is fired by element in UpdatePanel and refresh only update panels on the pa 阅读全文
posted @ 2011-11-29 10:36 Areas 阅读(232) 评论(0) 推荐(0)
摘要:大家都知道ASP.NET中GridView导出Excel的方法。在SharePoint中SPGridView是继承GridView的一个扩展控件,那么ASP.NET中的导出方法在SharePoint中也应适用。是可以用,但是有一个问题,就是第一次点击按钮导出成功后,你再次点击按钮的话,按钮就不在有用了。于是Google了一下,找到了这篇Export GridView to Excel in web part帖子解决了问题,就是在Page_Load中注册两行Javascript脚本。1protected void Page_Load(object sender, EventArgs e)2{3 阅读全文
posted @ 2011-11-29 10:33 Areas 阅读(309) 评论(0) 推荐(0)
摘要:三态工作流设计为通过三个状态(阶段)跟踪列表项的状态。它可用于管理要求组织跟踪大量问题或项目(如客户支持问题、销售商机或项目任务)的业务流程。三态工作流的工作方式设置用于三态工作流的列表向列表中添加三态工作流对项目启动三态工作流用三态工作流完成工作流任务三态工作流的工作方式三态工作流通过三个不同的状态和这些状态之间的两个转换,支持需要组织跟踪问题或项目状态的业务流程。每次在这些状态之间转换时,该工作流都会向用户分配任务并向该用户发送有关该任务的电子邮件通知。完成该任务后,该工作流会更新该项目的状态并进入下一状态。三态工作流设计用于“问题跟踪”列表模板,但也可以用于设置为包含“选项”栏(具有三个 阅读全文
posted @ 2011-11-29 08:57 Areas 阅读(296) 评论(0) 推荐(0)
摘要:Create a new C# Class Library project in Visual Studio .NET. After created, add a reference toMicrosoft.SharePoint.dll and System.Web.dll. Sign your project with a new key to make your assembly strong named.PublicColumnValue.csAdd a class called PublishColumnValue and let it inherit from SPFieldMult 阅读全文
posted @ 2011-11-27 12:59 Areas 阅读(512) 评论(0) 推荐(0)
摘要:MOSS2007的自定义字段类型v3 Creating Custom Field TypesCustom field types in SharePoint 2007 are pretty darn cool. They allow you to create your own subclasses of the existing SharePoint field types. You can control pretty much every aspect of the fields behavior. Things such as how the field is displayed/re 阅读全文
posted @ 2011-11-27 12:54 Areas 阅读(263) 评论(0) 推荐(0)
摘要:修改WSS的控件的RenderingTemplate,可以灵活的控制表单页面的显示。以前写过几篇相关的文章:WSS3.0开发--页面定制(1)--修改列表的表单页面WSS页面定制系列(2)---定制单个列表的表单页面WSS页面定制系列(3)---重写表单的保存逻辑WSS页面定制系列(4)--利用SmartForm和用户控件定制表单页面以上几篇提到了RenderingTemplate的简单修改方法,貌似很多朋友仍然不能掌握具体的方法,就再来一篇吧。WSS里有一个类TemplateBasedControl,从这个类继承下来,控件就具有了加载模板的功能。看一下这个类的方法: Code highlig 阅读全文
posted @ 2011-11-27 12:52 Areas 阅读(249) 评论(0) 推荐(0)
摘要:In SharePoint, a site column is a reusable column definition, or template, that you can assign to multiple lists across multiple SharePoint sites. Site columns are associated to a particular Data Type. This Data Type is called a Field. For example, when you create a site column, you are also prompte 阅读全文
posted @ 2011-11-27 12:52 Areas 阅读(487) 评论(0) 推荐(0)