惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Vercel News
Vercel News
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
Help Net Security
Help Net Security
月光博客
月光博客
N
News and Events Feed by Topic
Cloudbric
Cloudbric
博客园 - 司徒正美
L
LangChain Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tenable Blog
The Register - Security
The Register - Security
The Hacker News
The Hacker News
I
InfoQ
The Last Watchdog
The Last Watchdog
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
F
Fortinet All Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
C
Cisco Blogs
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
Latest news
Latest news
PCI Perspectives
PCI Perspectives
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
T
Tor Project blog
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Webroot Blog
Webroot Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - 追萝驴

Nginx + Frp + Let'sEncrypt 泛域名证书 Devexpress XAF的前端优化策略 本页不但包含安全的内容,也包含不安全的内容。是否显示不安全的内容 WIF应用与ADFS 2.0配置实战(续):实现SSO WIF应用与ADFS 2.0配置实战 配置了主机头后访问站点持续要求输入身份凭证,之后401.1 IE持续崩溃备忘 Sharepoint 2010 备忘 庆祝NH3 GA Released 兼思考两个问题的解决方案 - 追萝驴 WCF部署至IIS问题二则 WCF+Silverlight 异常处理 2 NHibernate: Batch Updates & Batch Inserts - 追萝驴 NHibernate: Session.Save 采用版本控制时无必要地自动Update版本字段的问题 WCF+Silverlight 异常处理 "Exception of type System.ExecutionEngineException was thrown" ExtJS: SuperBoxSelect supports single select mode [转]How to remove an assembly from the Cache if it is locked by Microsoft Installer Adding/removing fields and columns drag & drop bug's fix Ext JS继承: 关于object, constructor和prototype
APPDEV Sharepoint 2010 For Developers. 笔记
追萝驴 · 2010-12-10 · via 博客园 - 追萝驴

2010-12-10:

Module 01 -> 03.Basic Architecture:

  • 14\TEMPLATE\GLOBAL\v4.master
  • To enable code blocks, add a tag like the following in the web.config of the site:

代码

<SharePoint>
<SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
<PageParserPaths>
<PageParserPath VirtualPath="/*" IncludeSubFolders="true" CompilationMode="Always" AllowServerSideScript="true" />
</PageParserPaths>
</SafeMode>
......

  • Farm vs. Sandbox deployment

Module 02 -> 04. Feature Basics

14\Template\Features

FeatureName subdirectory

Feature.xml

  Must be named feature.xml

0 or more files containing feature elements

  By convention named elements.xml

0 or more files used by the feature

Feature Scopes

  • Farm
  • Web Application
  • Site
  • Web

Feature Schema

  • ActivationDependencies
  • ElementManifests
  • Properties
  • UpgardActions

Installing and Activating Features

Install

  Web Solution Package

  Stsadm.exe

Activate feature

  Site settings in browser

  Stsadm -o ActivateFeature

Lab: create feature.xml; can use wss.xsd as the xml schema.

关于Module参见:

http://msdn.microsoft.com/zh-cn/library/ms441170(v=office.12).aspx

http://msdn.microsoft.com/zh-cn/library/ms441170(v=office.14).aspx

注意事项:

Module的Url属性为该文档库的url地址,具体呈现在浏览器中,如地址为:

http://sp2010/TestWiki/Shared%20Documents1/Forms/AllItems.aspx

则Url属性值应为:Shared Documents1

如果出错了,更改elements文件后要重新install feature,不能简单地用-force选项:

stsadm -o installfeature -name DemoFeature -force

而应该先uninstall:

stsadm -o uninstallfeature -name DemoFeature

再重新安装

2010-12-11:

Module 02 -> 05.Feature Types

Sharepoint Manager 2010:

http://spm.codeplex.com/releases/view/51438

ContentType Element

Defines a type

Supports inheritance via ID

  • 0x - System
  • 0x01 - Item
  • 0x0101 - Document
  • 0x010102 - Picture

Custom types use GUIDs separated by 00

  • 0x010102008ee23f39......................

FieldRefs identify columns

错误排查:

记录下Correlation ID;然后到14\Logs下找到最近修改的log文件, ctrl+F Correlation ID。

ContentType Feature Activate成功后,可到site的Content Type Library中查找刚Activate的Content Type。如果找不到,需要iisreset一下。

继承类型:例如,继承自Item,则可以拥有Item的Title Column。

List Instance:

FeatureId:对应的List Type的Feature Id.例如,如果是一个CustomList,则到14\TEMPLATE\FEATURES\CustomList\Feature.xml下去查看Feature Id。

TemplateType:系统类型中,Feature Id最后的三位就是TemplateType。如果不确定,可以在上述的Feature.xml文件中找到ElementManifest的Location,然后按此Location找到对应文件查看其中记录的Type。

Content Type Binding:

Binds a content type to a list instance

Requires: ContentTypeId and ListUrl

Does not affect views(如果要affect views,应通过.net code做这个事情manually,通过Feature Receiver)

Feature Event Receivers
.NET code to run on

  • Install
  • Activate
  • Deactivate
  • Uninstall
  • Upgrade 

Solutions: Package features and other resources for deployment

VS 2010可以做到

pre-vs2010: WSPBuilder, STSDev

Solutions Files:

WSP extension

Cabinet file

Contains

  Manifest describing contents and install targets

  Features

  Assemblies

  Other files to target any location in SharePoint root

例如,MOSS自带的功能就能够生成一个这样的Package:

Site Settings->Site Actions->Save site as template

生成后,可以在Site Settings->Galleries->Solutions中找到它。(下载后,rename它为cab文件,即可打开)

安装solution(SandBox Solution):

在一个其他的Site,Site Settings->Galleries->Solutions->Upload Solution->Activate。

Site Actions->More Options...->Filter By: Site,找到刚才upload的solution,创建;

如果出错,通常是因为有一些Feature没有默认激活。所以查看原先的站点(since we are deploying a wsp saved as a template from an original site),对比一下,激活应该激活的feature,然后重试。

Module 03 -> 06. Visual Studio 2010

Avoiding Common Problems

  • Always run as administrator
  • Platform target should be "Any CPU" for console applications
  • References window won't show Microsoft.SharePoint(and others) when Client Profile is selected

Tricks: the missing asp.net page template

如果我们要在Module中添加ASP.NET页面,目前没有现成的模板。可以这样:在VS Solution中添加一个ASP.NET Web Application的项目,在其中创建ASP.NET页面。对于需要添加到Module中的文件,复制一份到Module中,这样,vs会自动替我们在Module的Elements.xml中添加这些文件;之后,在Web Application项目的Post Build Event Command中(或Pre Build?)添加指令,编译后复制对应文件即可。

Module 03 ->07. VS 2010 Visual Designers

Replaceable Parameters

Token for values unknown at design time

Works in the following file types by default

XML,ASCX,ASPX,Webpart,DWP

Examples

  • $SharePoint.Project.AssemblyFullName$
  • $SharePoint.Feature.Id$

2010-12-13:

Module 04->09.Exploring the Object Model

SharePoint Manager 2010 + VS Object Browser: 在SPM中查看各项属性,对应在Object Browser中查看属性的具体信息

Core Foundation Assemblies

  • Located in 14\ISAPI
  • Microsoft.SharePoint - Core classes
  • Microsoft.SharePoint.Client - Core classes for client applications
  • Microsoft.SharePoint.Linq - Linq to SharePoint
  • SharePoint specific workflow actions

Core Classes

SPSite

  SPWeb

    SPField

    SPContentType

    SPFile

    SPList

      SPListItem

    SPUser

SPContext

Security, Identity, and Impersonation

  • Default runtime identity: Authenticated user
  • Execution context: Current site collection; SPContext.Current.Site
  • Elevate Permissions: Via impersonation; New site collection object instance(例如,用new SPSite(guid)的方法或new SPSite(url)的方法)

SPSecurity.RunWithElevatedPrivileges

  • Delegate
  • Impersonate service account
  • Does not require user id or password
  • Permissions constrained by service account permissions
  • Requires a new instance of SPSite for security context

AllowUnsafeUpdates

Property of 

  • SPSite
  • SPWeb

Set to true to disable security validation on Update()

Required if persisting anything within RunWithElevatedPrivileges

Any exception, handled or otherwise, sets AllowUnsafeUpdates to False.

Custom Master Pages

startermasterpages.codeplex.com

code.msdn.microsoft.com/odcSP14StarterMaster

Key PlaceHolders:

  1. PlaceHolderAdditionalPageHead
  2. PlaceHolderMain
  3. PlaceHolderPageTitle
  4. PlaceHolderPageTitleInTitleArea
  5. PlaceHolderTopNavBar and related
  6. PlaceHolderLeftNavBar and related