SharePoint Add-in Model 介绍 - 引文(先导篇)

1. SharePoint 平台

如果你已经很熟悉 SharePoint 平台,可跳过本章节。

1.1 SharePoint 是什么

在介绍 Add-in Model 之前,简要提一下 SharePoint 是一个什么类型的产品?它有什么功能?先来看一下百度百科中的关于它的介绍:

SharePoint Portal Server 2003 是一个门户站点,使得企业能够开发出智能的门户站点,这个站点能够无缝连接到用户、团队和知识。因此人们能够更好地利用业务流程中的相关信息,更有效地开展工作。

SharePoint Portal Server 2003 提供了一个企业的业务解决方案,它利用了企业应用程序集成功能,以及灵活的部署选项和管理工具,将来自不同系统的信息集成到一个解决方案中。这个门户站点使得端到端的合作更为容易,实现了个人、团队和信息的整合、组织和搜索。用户可以通过门户内容和布局的定制和个性化以及目标受众,更快地找到相关信息。公司可以根据受众的公司职位、团队身份、兴趣或其他可以设置的成员规则来设定信息、程序和更新。

发行版本有SharePoint2003、SharePoint2007、Sharepoint 2010和SharePoint2013。

(源自 SharePoint - 百度百科)

简单来说, 它帮助企业和用户实现了企业内容的管理(如可存储、共享、协同编辑项目中的各种 Office 文档, 再比如它允许用户快速定制企业内部站点)和业务流程的管理(如将企业的日常业务流程如人事入职,出差申请,休假申请,加班申请,费用报销,项目立项,固定资产采购,公章使用等集中到 SharePoint 平台统一部署和管理)。

关于 SharePoint 更系统地介绍,推荐大家阅读 Office blogs - Evolution of SharePoint, 文中提到 SharePoint的核心feature 主要分为三大块:

  1. 提供了包括站点主页/入口, 搜索, 商业智能(BI), 和 企业内容管理在内的诸多功能。 (原文:Experiences such as portals, search, business intelligence (BI) and enterprise content management (ECM))
  2. 为上述功能提供了统一的管理工具。(原文:Across all of these experiences, SharePoint offers a consistent management layer providing control to customers.)
  3. SharePoint 是可扩展的,客户或其他合作伙伴能通过它所提供的扩展性平台增强原有功能。(原文:We also made SharePoint an extensible platform, allowing customers and partners to enhance the out-of-box experiences.)

Experiences, management and extensibility became the core aspects of what people love about SharePoint. As we move SharePoint forward, these three aspects continue to remain central—both within the server and across Office 365.

1.2 SharePoint 的产品分类

从架构上讲, 目前的 SharePoint 可大致分为两类: SharePoint on-premises 和 SharePoint Online, 两者的区别是:

  1. SharePoint on-premises 是由企业购买并部署在自家服务器(硬件)上的,在运行过程中升级、维护等均有企业解决,这种方式下,每个企业有自己独立的 SharePoint Farm, host 在自己的硬件上, 企业的 IT 部门拥有 Farm Admin 的权限。
  2. SharePoint Online 中的 Farm 的部署、硬件和负载均衡的配置等等均由微软或其合作伙伴提供支持和维护,而有需求使用 SharePoint 的企业仅需要购买 SharePoint Online 上的一个 Tenant (对应一个独特的域名, 不如 abc.microsoft.com) 即可。 而 Tenant 和 SharePoint Farm 的关系是 多对一的关系,也就是说,一个 Farm 上可能有很多 Tenant, 而一个 Tenant 只能在一个 Farm 上。企业的 IT 部门用户 Tenant Admin 的权限(与 Farm Admin 的权限是有差异的)。

SharePoint Online is when Microsoft manages SharePoint in their data centers and you access it over the Internet. SharePoint On Premise is when your local IT gurus manage SharePoint in your company data center.
(源自 Differences between SharePoint Online and SharePoint On Premise)

而在本文中提到的 SharePoint 平台一般是指两种产品,如有特殊,会特别注明。

1.3 SharePoint 平台上的扩展功能开发

前面提到了 SharePoint 的 Extensibility, 我们先看一下当前 SharePoint 所提供的扩展平台的发展概况:

Extensibility

SharePoint got to where it is today with the help of over 3.4 million developers worldwide who built extensions and customizations on top of the platform. This principle holds true moving forward—while the way developers build for the cloud is different—we absolutely want to enable customers and partners to build new, innovative applications and customizations that meet their needs. We are doing this by continuing to advance the app model we introduced with SharePoint 2013, bringing more custom capabilities as well as making it easy to connect to data in SharePoint through a rich set of Office 365 APIs. We will keep investing in the surface area of these APIs plus introduce totally new APIs (like Office Graph and Office 365 Video) to enable even deeper levels of integration. IT, developers and partners will be able to achieve greater levels of customization for their customers.

We are seeing rapid growth of customers using apps and APIs, which integrate and connect with SharePoint data every day in Office 365. Customers are leveraging our training, guidance and code in our open source Patterns and Practices project to achieve the level of sophisticated solutions previously delivered using full-trust code on-premises. But we know developers are asking for more and we love listening to the feedback! The opportunity to develop new capabilities and integrations with SharePoint has never been more exciting. The development innovation pipeline is chartered to unblock and enable developers. Get your 1s and 0s ready—and code!

(源自 Evolution of SharePoint)

文中提到几个信息:

  1. 全球有超过 3.4 百万围绕 SharePoint 的开发者,他们基于 SharePoint 扩展开发平台构建各种功能性扩展和自定义解决方案。
  2. 有越来越多的 Office 365 客户开始使用 SharePoint apps(add-ins) 和 APIs 去与 存储在 SharePoint 上的数据交互。通过开源项目 open source Patterns and Practices 的引导, 他们利用新的 add-in model 实现了复杂程度各异的解决方案( 而在过去,这些方案一般在 on-premises 上利用可以执行 full-trust code 的 Farm solution 方式实现)
  3. 同时, 微软也间接地承认了新的 add-in model 并没有提供给开发者所有由原来 Full-Trust-Code 带来的扩展能力, 平台的支持仍需要通过增加新的 API 来增强。

回过头来,上面提到的“新的 add-in model” 并非是唯一一种扩展 SharePoint 功能的方法。事实上, SharePoint 平台先后发布了三种不同的“扩展功能开发模型”

  1. Farm Solution(Full-Trust-Code)
  2. Sandboxed Solution
  3. SharePoint Add-in Model(在 SharePoint 2013 中开始引入, 原来也叫做 SharePoint Apps)

三种开发模型各具特色, 本文简单介绍 add-in model 下的 add-in/app 是如何被用户使用的。 在后续的文章中会分析比较三种开发模型的不同之处(优劣)。

2. SharePoint Add-in Model 概况(就真的只是概况哟)

SharePoint Add-in Model 是 SharePoint 2013 中引入的新的开发模型,前文中也多次提到这种新的 model, 总的来说, add-in model 是微软推荐的 SP 扩展开发趋势。

There’s a new kid in town, the App model. SharePoint Apps can be hosted in an isolated SharePoint site, or separate from the SharePoint farm, either on a dedicated self-hosted application server or in the cloud (Azure). SharePoint Apps then have to leverage the extended and improved client object model to connect back to the SharePoint farm if they want to do some work there (SharePoint server-side code is not allowed/possible for Apps). The major advantages of SharePoint apps are twofold:
1.A separated app in itself doesn’t affect the performance of the SharePoint farm in any way, and doesn’t have to be managed from within the SharePoint farm. Having said that, do keep in mind that apps leveraging the SharePoint client object model of course impact SharePoint farm performance in an indirect way.
2.As a developer/software company, you can distribute apps via the MS App Store which greatly facilitates finding an audience to redistribute your mind works, potentially making money doing that.

简单来说, add-in model 的特点如下:

  1. 开发出的 add-in 可以 host 在一个独立的 SharePoint site 上( 每个 add-in 有一个独立的 site ), 也可以 host 在 SharePoint farm 之外的任何服务器上。也就是它支持 self-host 和 out-of-box hosting 两种方式。
  2. add-in model 不允许使用任何 SharePoint server-side 的 code, 开发者只能利用 client object model (JSOM 或者 CSOM) 与 SharePoint 进行交互, 当然也可以利用 Office365 提供的所有的 REST APIs。
  3. add-in 本身并未像 Farm solution 一样成为 SharePoint farm 个一部分, 接受 farm 的管理, 所有并不会很大程度地影响到 farm 的性能。但是另一方面, add-in 并非完全不会影响 farm 的性能, 比如它使用的 client object model 势必还是会被 SharePoint farm 处理。
  4. 可以根据需求发布到 office store 中或者企业内部的 SharePoint catalog 中。其中发布到 store 中的 add-in 可以被任何其他 SharePoint 用户购买(当然可以免费)使用。

2.1 SharePoint Add-in 的部署方式

开发者基于 SharePoint Add-in Model 开发的应用,我们称为 SharePoint add-in 或者 app, 微软为这类应用提供了统一的发布商店 - Office 应用商店 - SharePoint 相关应用。相信大家也能猜到(类似 Windows Store, Google Play, Apple App Store), 开发者可以向 Office Store 提交发布 add-in 的申请。Add-in 通过审核后, 该 add-in 就会上架到 Office 商店中, SharePoint 网站用户可以通过访问这个公共商城获取它。

事实上,除了 Office 应用商店, 开发者可以将基于 add-in model 开发的 add-in 部署在企业内部的 SharePoint app catalog 中, 此时该 add-in 仅能被企业内部用户使用。

There are two types of app store in SharePoint 2013. The first is a 'public store,' which is the main app store that Microsoft has been marketing heavily. Users connect to it from within SharePoint, and it adheres to the now standard rules of a typical store. There is a search function, and users can also browse by genre. Once selected an app is downloaded and installed directly onto the SharePoint environment.

(源自 The power of the SharePoint 2013 App store)

2.2 SharePoint Add-in 的获取/安装

如果你是某个 SharePoint site 的 site owners, 那么可以为它添加 SharePoint add-in。

SharePoint 可通过两种方式安装 Add-in:

  1. 手动从 SharePoint app store 或者 企业内部 SharePoint app catalog 中安装
  2. 使用 PowerShell 脚本安装

详细安装要求及步骤,可参照 Add apps for SharePoint to a SharePoint 2013 site, 对应的中文文档,可将该链接 url 中的 en-us 改为 zh-cn 查看。

3. 参考资料

  1. https://blogs.office.com/2015/02/02/evolution-sharepoint/ "Evolution of SharePoint"
  2. http://www.dummies.com/how-to/content/differences-between-sharepoint-online-and-sharepoi.html "Differences between SharePoint Online and SharePoint On Premise"
  3. http://baike.baidu.com/link?url=rIM1rGwXc1Hrt0AYjA2W2cFHfiinJS_skpqDddTmjMTRKVHDvBNJrJB7usobk38JczZk2zGtT88kJ1AV7ijbKa "SharePoint - 百度百科"
  4. https://store.office.com/appshome.aspx?ui=zh-CN&rs=zh-CN&ad=CN&clickedfilter=OfficeProductFilter%3ASharePoint&productgroup=SharePoint "Office 应用商店 - SharePoint 相关应用"
  5. http://www.brightstarr.com/sharepoint-technology-and-application-insights/the-power-of-the-sharepoint-2013-app-store "The power of the SharePoint 2013 App store"
  6. https://technet.microsoft.com/en-us/library/fp161231.aspx "Add apps for SharePoint to a SharePoint 2013 site"
  7. http://blog.sina.com.cn/s/blog_4aa29f750101an75.html "SharePoint 2013 App 开发概述"

本文大多数描述源于官方博客, 但也不乏个人见解以及其他开发者的相关博客,如果你觉得有不妥之处,还望指教,谢谢!

原文地址: http://www.cnblogs.com/simpeng/p/4842274.html , 如需转载,请注明出处!

posted @ 2015-09-27 15:26  SIMPENG  阅读(1630)  评论(0编辑  收藏  举报