SharePoint 2013 App介绍2
本文是在"SharePoint 2013 App介绍1”的续篇,在前一篇博文中我介绍了微软引入App编程模型的原因。实际上SharePoint 2013 App 不仅可以解决SharePoint 2010所面临的问题,并且引入了很多新的特性和功能。
理解SharePoint Apps的要点:
SharePoint site 中的所有内容(List, Library)现在都是一个 App
没有custom code在SharePoint server上运行
更容易升级和迁移
减少开发人员学习的时间
可以使用新的App host环境的功能,比如如果Host server为Windows Azure,那么SharePoint App就可以使用Windows Azure的功能和特性了
在SharePoint farm solution和SharePoint sandboxed solution之外提供了另外一种开发SharePoint应用的方式,在SharePoint 2013中还是可以SharePoint farm solution 和SharePoint sandboxed solution开发SharePoint应用的。
那么在SharePoint 2013的开发过程中该采用哪种开发方式呢?
Farm Solutions
Sandboxed Solutions
SharePoint Apps
什么时候使用
仅当Apps无法满足需求时才考虑使用
在SharePoint 2013 中不建议使用,但是为了兼容SharePoint 2010中迁移过来的Solution, SharePoint 2013仍然支持
微软推荐的开发SharePoint 应用的方式
能否只用Server-Side SharePoint API
可以
可以用大部分,但是有限制
App中禁止在SharePoint server 上使用Server-Side SharePoint API,但可以在其它Host Server(如Windows Azure)上调用
能否只用Client-Side SharePoint API
可以
可以
可以,在前一个版本上增强很多(对Workflow, UserProfiles, TranslationServices,Search,Taxonomy等的支持)
是否支持托管和云部署
不支持
支持托管
支持
处理 安装/升级/卸载
需要编写对应事件的代码
需要编写对应事件的代码
微软提供友好的用户体验,不需要开发人员处理
服务器中断服务
服务端劣质代码可能导致服务中断
不会导致服务中断
不会导致服务中断
授权与认证
内部信任
部分信任
分两种情况
- SharePoint host 的App:使用SharePoint 站点上下文中的security token 非SharePoint host:
- 使用Client Object Model 跨域访问Server端代码使用OAuth REST APIs
可以开发什么?
所有组件都可以使用Farm Solution来开发
大部分组件可以,但是有些限制:
- 使用Farm之外的资源访问数据库 调用非托管代码写磁盘访问不同Site collection中的资源
Apps可以开发 :
- Custom Web Parts (remote pages that contain custom Web Parts) Event receivers and Feature receivers(remote event receivers)Custom field (column) typesCustom web services built on the SharePoint Service Application Framework Application pages
不可以开发 -
- Custom site definitionsCustom themesCustom action groups and custom action hiding User controls (.ascx files)Delegate controls