何小碩's profileGet More... ExperiencePhotosBlogListsMore ![]() | Help |
|
April 26 MOSS 2007/WSS V3.0 Version guideHere is a quick table for those who want to find out what version of WSS/MOSS you are currently patched up to:
Published Thursday, July 31, 2008 10:18 PM by ASaikov Checking your database schema versionUpdated with Infrastructure update Information (July 15th, 2008) You have decided to migrate to the SP1 of EPM 2007 and/or MOSS 2007. During the upgrade (done by the configuration wizard), the databases are upgraded also. If you want to check the schema version of the databases, you can use this query in any of your farm database: SELECT * FROM Versions The very last version that maps to the GUID {00000000-0000-0000-0000-000000000000} with the highest ID should equal the current version of the product Here is a table showing the different database versions (Thanks Brian http://blogs.msdn.com/brismith) Updated with Infrastructure Update Information WSS: http://support.microsoft.com/kb/95165 Office Server http://support.microsoft.com/kb/951297
If you attach a RTM content database or if you provision a new project server site with four RTM databases on a SP1 installation, the RTM databases are upgraded to SP1 during the provisioning. You may have less lines in your databases, if they were created after applying the SP1 a Rollup or the infrastructure update. Posted: Thursday, January 10, 2008 7:51 PM by shaden MOSS 2007 Trick - Search Scopes + Managed Properties = Tasty Dish!I wrote and erased the title of this post about 60 times before I settled on the above. There is so much tweaking you can do to MOSS's results, that a broad enough title didn't do enough justice to MOSS search's flexibility. So, here is a restrictive title, but a rather cool but specific trick you can do with MOSS 2007 search. Under shared services, go to search settings. Under there you would see "Metadata property mappings". Under there, you would see a number of "Managed Properties" already setup for you. You could add your own if you wanted to by clicking on the "New Managed Property" button above. These Managed properties can be used in search scopes - and that is a very very powerful concept. Say for instance, if you wanted to search over all the "Word documents" on your local sharepoint sites - how would you do that? Well, it's pretty simple.
Go ahead and play with other managed properties, and new managed properties that you can slice and dice your content in searching for. For one, you can now slice and dice your data based on content types (No really you can !). Go try it out ! :-) This gets ESPECIALLY powerful with BDC search. BDC will let you create new crawled properties, and you can then map them to managed properties, and slice and dice LOB data in any form you want - through a search engine. Pretty powerful stuff IMO. Posted on 5/17/2007 @ 12:08 AM in #Sharepoint Adding Properties to MOSS Advanced Search
In the Advanced Search Box Pane, click on the Properties Menu and then select the content in the Properties Text Box. In order that your Managed Properties appears in the Properties lists, you need to make changes in the XML file content.
The XML File in Properties has the following structure:
LicenseThis article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below. A list of licenses authors might use can be found here About the AuthorUpgrade SQL Server DTS Packages to SQL Server Integration Services SSIS PackagesProblem Solution ID 1
2 3 Press the 'Next >' button to continue the process.
4 Press the 'Next >' button to continue the process.
5 Press the 'Next >' button to continue the process.
6 Press the 'Next >' button to continue the process.
7 8 9 For information on deploying SSIS Packages, reference - SQL Server Crosswalk - Deploying a SQL 2000 DTS vs. a SQL 2005 SSIS package. Next Steps
Written By: Edgewood Solutions Engineers SQL 2008 FILESTREAM and Sharepoint Document Libraries(中文版)FILESTREAM是SQL Server 2008中的一个新特性,允许以独立文件的形式存放大对象数据,而不是以往一样将所有数据都保存到数据文件中。以往在对业务系统的文件进行管理时有两种方法,一种是将文件保存到服务器文件系统中,数据库中只保存了该文件的路径,在使用该文件时应用程序连接到服务器读取文件;另一种是将文件以varbinary(max)或image数据类型保存到SQL Server中。而SQL Server 2008提供了FILESTREAM,结合这两种方式的优点。 FILESTREAM使SQL Server数据库引擎和NTFS文件系统成为了一个整体。Transact-SQL语句可以插入、更新、查询、搜索和备份FILESTREAM数据。FILESTREAM使用NT系统缓存来缓存文件数据。这有助于减少FILESTREAM数据可能对数据库引擎性能产生的任何影响。由于没有使用SQL Server缓冲池,因此该内存可用于查询处理。 在SQL Server中,BLOB可以是将数据存储在表中的标准varbinary(max)数据,也可以是将数据存储在文件系统中的FILESTREAM varbinary(max)对象。数据的大小和应用情况决定您应该使用数据库存储还是文件系统存储。如果满足以下条件,则应考虑使用FILESTREAM:
对于较小的对象,将varbinary(max)BLOB存储在数据库中通常会提供更为优异的流性能。 FILESTREAM存储以varbinary(max)列的形式实现,在该列中数据以BLOB的形式存储在文件系统中。BLOB的大小仅受文件系统容量大小的限制。文件大小为2GB的varbinary(max)标准限制不适用于存储在文件系统中的BLOB。 若要将指定列使用FILESTREAM存储在文件系统中,对varbinary(max)列指定FILESTREAM属性。这样数据库引擎会将该列的所有数据存储在文件系统,而不是数据库文件中。 FILESTREAM数据必须存储在FILESTREAM文件组中。FILESTREAM文件组是包含文件系统目录而非文件本身的专用文件组。这些文件系统目录称为“数据容器”。数据容器是数据库引擎存储与文件系统存储之间的接口。 使用FILESTREAM存储时,需要注意以下内容:
使用FILESTREAM在开始使用FILESTREAM之前,必须在SQL Server数据库引擎实例中启用FILESTREAM。具体启用数据库实例FILESTREAM的操作如下: (1)在SQL Server配置管理器中打开SQL Server数据库引擎的属性窗口,切换到FILESTREAM选项卡,如图所示。 (2)选中“针对Transact-SQL访问启用FILESTREAM”复选框,其他的选项是针对Windows进行读写的,可以都选中,然后单击“确定”按钮保存对FILESTREAM的设置。 (3)打开SSMS连接到数据库实例,右击数据库实例,选择“属性”选项,系统将打开SQL Server实例的属性窗口。 (4)切换的“高级”选项页,在文件流访问级别下拉列表框中选择“已启用完全访问”选项,如图所示。 (5)单击“确定”按钮,然后重启数据库实例,FILESTREAM在数据库实例中设置完成。 在启用了数据库实例的FILESTREAM后,接下来就需要设置数据库的FILESTREAM和创建具有FILESTREAM数据列的表: (6)对应新建的数据库,则在创建数据库时创建FILESTREAM文件组,如果是现有数据库,则使用ALTER DATABASE添加FILESTREAM的文件组,例如对TestDB1数据库添加FILESTREAM的文件组,具体SQL脚本如代码: ALTER DATABASE [TestDB1] 系统将自动创建C:\FileStream文件夹并在其中写入filestream.hdr文件,该文件是 FILESTREAM容器的头文件不能删除,一定要确保在运行该语句之前C:\FileStream并不存在。 (7)创建了FILESTREAM文件组后便可创建和修改表,指定某varbinary(max)类型的列包含FILESTREAM数据。例如创建Files表,该表包含FileID和FIleContent列,具体脚本如代码: CREATE TABLE Files 管理与使用FILESTREAM在创建好FILESTREAM表后即可向其中添加、修改和读取数据。SQL Server支持使用T-SQL和WIN32 API两种方式访问FILESTREAM。 对于T-SQL访问FILESTREAM数据列来说,FILESTREAM是完全透明的,也就是说,T-SQL仍然使用一般的访问varbinary(max)数据列的方式访问,并不会因为是FILESTREAM列而有所不同。 例如向Files表中插入数据、修改表数据和删除数据的SQL脚本如代码: INSERT INTO Files --插入测试数据 无论是插入数据还是修改数据,SQL Server都将在文件系统中创建新的文件来保存最新的修改文件内容,修改或删除数据后文件系统中的文件将保留,而不会被同时删除。 使用FILESTREAM来存储二进制大型对象(BLOB)数据时,可使用Win32 API来处理文件。为了支持在Win32应用程序中处理FILESTREAMBLOB数据。所有FILESTREAM数据容器访问都是在SQL Server事务中执行的。可在同一事务中执行T-SQL语句以保持SQL数据和FILESTREAM数据之间的一致性。 【出自博客园深蓝居,转载请注明作者出处】 SQL 2008 FILESTREAM and Sharepoint Document LibrariesWhen I first read about sql server 2008 filestream I don't know why (or I know ;)) Before start, if you want to know all the detail about FILESTREAM read FILESTREAM Storage in SQL Server 2008 OK let's start: First of all (if you didn't enable FILESTREAM during SQL Server 2008 installation),
You also have to specify the FILESTREAM filegroup for that table: Et voilà, if you go to your filestream directory (c:\MyDBData\FSDATA) you will notice the presence of a new directory and a subdirectory. Now you can go yo your site collection, create a new document library, upload some documents, Hope this helps Microsoft SharePoint “14” is now Microsoft SharePoint 2010You have probably seen the news announcement today where we announced the public beta for the new Microsoft Exchange Server 2010. As part of that announcement, we also talked about some of the names for the “14” wave of products including Microsoft Office 2010 and Microsoft SharePoint Server 2010. I wanted to answer some questions that I think will inevitably pop to the top of your mind: What happened to the Office piece of the name? We love MOSS. . . . The first thing you’ll notice is that the MOSS acronym goes away with the new name since Office is no longer in the SharePoint official name. No one should worry that SharePoint doesn’t work great with Office 2010 since we removed Office from the name, just like people didn’t worry whether SharePoint was a great portal product when we removed Portal from the 2007 name. The primary reason why we took Office out of the name - lots of folks associate the name Office with the Office client. We wanted to take the opportunity to reestablish the Office name and brand to be synonymous with the client suite. I say “Give the people what they Want” so everyone should immediately think of Microsoft Office = Office apps. Don’t try to acronym Microsoft SharePoint Server to MSS since MSS is already taken by Microsoft Search Server. Just remember, SharePoint is SharePoint is SharePoint. What about Windows SharePoint Services? When you read through the announcement, you may be wondering what happened to Windows SharePoint Services. While we didn’t announcement anything new for WSS, and I want to assure you that we’re definitely working on a new v4 version of the product. It’s too early to drill into any of the details but WSS is getting a lot of new features and will be a great release. We’ll talk more about WSS at a later date. So, what was announced? Here are my key takeaways from the interview with Chris Capossela: • Exchange 2010 will lead the way for the 2010 (previously referred by its codename “14”) wave of technologies and it will be available in the second half of 2009. You can download a beta today. • Using Office Web applications, customers will be able to create, edit and collaborate on Office documents through a browser. • IT professionals will be able to choose to either deploy and manage on-premises or hosted as a service. • For developers, we are working on Open APIs, deep support for industry standards and developer tool support with Visual Studio 2010. You can read the entire interview here. Thomas Rizzo Published Tuesday, April 14, 2009 4:37 PM by sptblog Service Pack 2 for the 2007 Microsoft Office System due to ship April 28thLast October, we announced the upcoming release of the 2nd service pack for the 2007 Microsoft Office System and the 2007 Microsoft Office servers. Today, we’re happy to provide both a formal release date, and more details on what you should expect to see in SP2. A fair amount has been said about SP2 already, but there is a lot more to share. We’ll cover the highlights here, but please check back on April 28th when all of our documentation will be published. It is important to remember that the information provided today is by no means a comprehensive list. We worked with the individual teams in Office to come up with a list of changes that they were most proud of and felt would be most beneficial to you, our valued customers. In addition to the numerous product improvements introduced by SP2, you may also notice that our SP2 documentation has been overhauled. Gone are the days of the long-winded or too sparse knowledge base articles that do little to describe what’s included in the actual service pack or that include details that may not be what you are looking for. In their place are what we hope are more user-friendly and informative KB’s. The technical information still exists, but it has been pulled from the main KB articles and now will live on TechNet. And, back by popular demand, is the spreadsheet listing individual bugs that were fixed across all of our products. The Service Pack team would like to express our sincere thanks to the many beta testers who took the time to download, install, test, and provide feedback to us. This was the largest beta we’ve done to date for an Office service pack with thousands of beta testers from over 60 countries. We know your time is extremely valuable, and we very much appreciate all you’ve done. Your efforts have helped to make this a great release! Don’t forget to come back on April 28th. We’ll have a comprehensive list of everything we’ve released, where you can find it, and links to additional information. A brief note, some of the information posted earlier needed clarification. We have made slight modifications to the information below. Very sincerely, The Office Service Pack team We’ll start with updates that pertain to multiple products, highlight fixes to the individual desktop applications, and then discuss fixes to the server products. Changes that impact desktop applications
The 2007 Office Suite SP2 has been tested and is supported for Internet Explorer 8. Windows Vista SP2, Windows Server 2008 SP2, Windows 7 and Windows Server R2 will all be supported upon their release. Access
Excel
Groove
InfoPath
OneNote
Outlook
PowerPoint
Project
Publisher
Visio
Word
Changes that impact the server products Windows SharePoint Services 3.0 SP2 and Microsoft Office SharePoint Server SP2 include fixes and enhancements designed to improve performance, availability, and stability in your server farms. SP2 provides the groundwork for future major releases of SharePoint Products and Technologies.
Windows Server 2008 SP2 and Windows Server 2008 R2 will be supported on their release. Enterprise Content Management (ECM)
Excel Services
Groove Server
Forms Server
Project Server
Search Server
Note: Two minor changes were made on April 22, 2009 to the original post of this blog. The changes were: Substantial improvements to Forms-based authentication was moved to the desktop section and support in Word, Excel, PowerPoint and SharePointDesigner was added to the sentence. Windows Server R2 was changed to Windows Server 2008 R2. Published Thursday, April 16, 2009 1:50 AM by The Microsoft Office Sustained Engineering Team April 12 Creating a Custom Control FeatureHeya folks, It's time for another Feature! Woo HOO!! This a definite must know for WSS 3.0 and MOSS 2007. Ok, so this feature will deploy a custom search box control that can be called in your own Master Page or Page Layout. Let's walk through the steps needed to create this Cool, reusable feature. < %@ Control Language="C#" Inherits="Microsoft.SharePoint.WebControls.SearchArea,Microsoft.SharePoint,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" compilationMode="Always" % > 3.)Create a feature folder named CustomSearch, this folder will host our feature. < ?xml version="1.0" encoding="utf-8" ? > You'll notice that we have all of the needed attributes for our feature.xml element (ID [guid], Title, description, etc..), this is fairly straight forward. The interesting piece of this xml file comes in the "ElementManifest" element, this element has a reference to a file not yet created called "CustomSearchArea.xml". "CustomSearchArea.xml" will contain specific meta-data for our new Custom Search control. Let's create that file. < ?xml version="1.0" encoding="utf-8"? > This is the only "quasi" tricky part in this walkthrough. As we've seen with our previous Feature, the "Elements" element contains the actual definition for the item we're provisioning or creating. The "Control" element contains the definition of our new Custom Control. This element has ID, Sequence, and ControlSrc attributes which directly reference the control we're creating. In our control we define an ID of "CustomSearchBox", a custom sequence of "100", and in our ControlSrc we directly reference the "CustomSearchArea.ascx" file (In our case this file will live in the "ControlTemplates" folder of our 12 hive). These attributes gives SharePoint all the info it needs to declare a new Custom control. Posted by Eric Stallworth at 9:56 PM MOSS2007 – Show multiple columns in CQWPAfter receiving a couple of emails about displaying multiple columns within the CQWP, I decided to post about it as a step by step. So here goes. To begin with I have created the following structure:
What I am hoping to achieve is consolidate the entire contacts, into a single list that appears at the root demo site. I have created the following sites as shown below and their respective lists.
Each of the above lists has a few contacts added for demo purposes.
Firstly we need to edit the page that we want to display the contacts list on. For this demonstration I have created a custom web part page. Simply press the "Site Actions" menu and select the "Edit Page" option.
Now press the "Add Web Part" button.
You will then need to select the "Content Query Web Part" and add this to the page.
By default when the CQWP renders it will show generally news items and pages. Click the arrow to modify the web part.
You now need to set the query properties of the CQWP to point to the contact content type. This is done by setting the properties as below:
Upon applying these settings, the CQWP should render as below:
Now we have it connected to the correct lists we now need to modify the web part itself to connect to all the fields that we want to show and then make a custom style for displaying these in a different way. So to begin lets press the arrow for modifying the web part and select export:
When prompted save it to your desktop.
You now need to open this file in an editor such as Visual Studio, SharePoint Designer or like me just good old notepad!! Within the document you are looking for the "CommonViewFields" property.
In order to add the correct fields you firstly need to know what the internal names are of the fields. Press the "Settings" then select "List Settings" on the list you wish to know the fields from.
When accesssin the page you will see a list of all the fields that are part of this list or associated content types.
However this does not give us the actual internal names of these fields. To do this we will need to look at the site columns that exist within the content type itself. Press the "Site Actions" menu and the "Settings", then press to go to the root of the site and select the "Site Content Types".
From the list that appears select the "List Content Types" and then press the "Contact" link.
The fields names should then be listed as below:
When you hover your mouse over the field you can look at the status bar of the browser and see the actual internal field name as shown below, or you can click into the field and access it's name from the URL that appears in the browser.
Now we know how to find the exact internal names we need to modify the CQWP lines to look as below: <property name="CommonViewFields" type="string"> FullName,Text;Company,Text;JobTitle,Text;Email,Text;WorkPhone,Text;CellPhone,Text;City,Text; </property> In case you are not sure of the syntax: Fieldname,Type Save this file now. This then needs to be imported to the page and replace the one we added earlier. To do this edit the page and then press to add a web part as before. Simply close the current web part:
Now press the following link on the web part window:
And select the import option that appears on header bar of the task pane that appears.
Browse to the web part we modifed earlier and import to the page. It should then show as below, notice it looks exactly like the other one did (for now).
However even though it renders the same way it is loading all the other fields in the background but not displaying them. To make them display we need to make some changes to the "ItemStyle.xsl" file. This can be done by selecting the "Manage Content and Structure" link from the "Site Actions" menu.
You will then need to select the "Open in New Window" from the menu that appears on the "Style Library" folder.
Once this is open press on the folder below:
At this point take a backup of the "ItemStyle.xsl" file and then edit the existing one in an XML Editor.
I have opened mine in Notepad. Now the structure of the "ItemStyle.xsl" is basically made up of a XSL Templates that will render the content in different layouts. The layout I am after is simple. I want to show a certain amount of fields and have hyperlinks for viewing all the details, email and links to call their numbers using skype. Firstly make a copy of one of the styles that exist and then rename the top line as below: <xsl:template name="ContactsList" match="Row[@Style='ContactsList']" mode="itemstyle"> The next set of code is not changed from any of the original styles: <xsl:variable name="SafeLinkUrl"> <xsl:call-template name="OuterTemplate.GetSafeLink"> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="DisplayTitle"> <xsl:call-template name="OuterTemplate.GetTitle"> <xsl:with-param name="Title" select="@FullName"/> <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/> </xsl:call-template> </xsl:variable> <xsl:variable name="LinkTarget"> <xsl:if test="@OpenInNewWindow = 'True'" >_blank</xsl:if> </xsl:variable> Now we get into creating our own custom layout. <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/> <table> <tr> <td style="width:100px" class="item link-item"><a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}"> <xsl:value-of select="$DisplayTitle"/> </a> </td> <td style="width:160px" class="item link-item"><xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/><a href="#"><xsl:value-of select="@Company" /></a></td> <td style="width:200px" class="item link-item"><a href="#"><xsl:value-of select="@JobTitle" /></a></td> <td style="width:300px" class="item link-item"><a href="mailto://{@Email}"><xsl:value-of select="@Email" /></a></td> <td style="width:150px" class="item link-item"><a href="callto://{@WorkPhone}"><xsl:value-of select="@WorkPhone" /></a></td> </tr> </table> </xsl:template> Once you have finished modifying the "ItemStyle.xsl" you will need to save it and then check it back in. You will now need to modify the web part again and select the new style from the presentation list of styles as shown below:
The CQWP should then render as below:
As you can see utilising content types and the CQWP will allow you to display content in different styles and layouts from accross your site. Wednesday, 25 Jul 2007 06:17 by Ishai Sagi MOSS 2007 and Code Access SecurityDownload Sample Custom Policy File Have you ever written a web part or a web service? If yes then you must have dealt with a security problem. Writing a web part or web service may not be a big issue but deploying them is certainly a headache. You start getting permission errors as soon as you deploy your code on the server. I recently wrote an article demonstrating the web service creation process and I promised in that article that I would write about Code Access Security (CAS) in another article. There are three ways to assign execution permissions to your code: 1. Increase the trust level for the entire virtual server In the article, we installed our assembly in the GAC but the safest method is to create a custom policy file for the assembly. Following article on MSDN contains complete details on code access security: Microsoft Windows SharePoint Services and Code Access Security Written in July 2003, this is one of the most comprehensive articles written on "SharePoint and Code Access Security". For security reasons, the assembly must be installed in the bin directory of the application instead of GAC but installing it in the bin directory requires you to assign execution permissions to the assembly. One way is to increase the trust level of the entire virtual server. This is easy to implement but this option is least secure as it affects all assemblies used by that virtual server. Second way is to create a custom policy file and this is the recommended approach. This option is most secure but difficult to implement. In this article, we will create a custom policy file for an assembly (web service assembly) written for MOSS 2007. Creating a Custom Policy File 1. Go to the following location on the server: LocalDrive:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG 2. Make a copy of wss_minimaltrust.config and rename it wss_customtrust.config. 3. Open wss_customtrust.config file using any text editor. 4. Under the <SecurityClasses> element, add a reference to the SharePointPermissions class as follows: <SecurityClass Name="SharePointPermission" Description="Microsoft.SharePoint.Security.SharePointPermission, Microsoft.SharePoint.Security, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c." /> 5. Search for the <PermissionSet> tag where the name attribute equals ASP.NET. If you couldn't find that <PermissionSet> tag, locate the one that has SPRestricted in the name attribute. 6. Copy the entire tag and all of its children, and paste a copy of it immediately below the one you copied. 7. Change the name of the PermissionSet element from ASP.NET (or SPRestricted) to CustomTrust. Before: <PermissionSet After: <PermissionSet 8. Add the following <IPermission> node to the <PermissionSet> element where the name attribute equals CustomTrust: <IPermission class="SharePointPermission" Therefore, the resulting customized <PermissionSet> will look as follows: <PermissionSet <IPermission <IPermission <IPermission class="WebPartPermission" <IPermission class="SharePointPermission" 9. Once you define the customized element, you must create a code group to specify when the CLR should apply the permission set. (For details, see the original Microsoft article). Locate <CodeGroup> tag where the class attribute equals FirstMatchCodeGroup and copy following CodeGroup immediately below it: <CodeGroup class="UnionCodeGroup" The membership condition for this new code group is based on URL membership and the URL points to the bin directory. The permissions will be applied to all the assemblies in the bin directory of the current application. You can also use strong name membership but then the permissions will be applied only to one assembly. For example, if I have written a web service and I wanted to assign permissions to my assembly only, I would use strong name membership. Copy following code immediately below the <CodeGroup> tag where the class attribute equals FirstMatchCodeGroup, if you want to use strong name membership: <CodeGroup class="UnionCodeGroup" Replace PublicKeyBlob value with your own value and change the name of the assembly in the Name attribute. Name attribute contains the name of the assembly. To retrieve the public key blob for an assembly, use the secutil.exe tool. Please note that publickeyblob is different from publickeytoken. Secutil.exe is located in the following folder: LocalDrive:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin To retrieve the public key blob for your assembly, either copy the secutil.exe tool to the folder that contains your assembly else provide exact path to the assembly in the command, and run the tool as follows: secutil.exe -hex -s UploadService.dll > blob.txt UploadService.dll is the name of the assembly. This command will create a text file named blob.txt. Open blob.txt and copy the public key and paste it in the publickeyblob attribute. 10. Save and close the file. The policy file is ready to use. 11. Open the web.config file for the virtual server where you have deployed your component and add the following <trustlevel> tag to the SecurityPolicy element: <trustLevel name="WSS_Custom" policyFile="LocalDrive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\wss_customtrust.config" /> Virtual Directories for web applications are located in the following folder: LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories Suppose I want to deploy my web service in the web application configured at port 17316. The URL of that application would be http://localhost:17316 and its virtual directory will be: LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories\17315 Create a bin folder in this path and copy your assembly to the bin folder. The web.config for this virtual server will be located in the following folder: LocalDrive:\Inetpub\wwwroot\wss\VirtualDirectories\17315 In the web.config file, change the <trust> tag so that it refers to the newly defined trust level. <trust level="WSS_Custom" originUrl="" /> 12. Save and close the web.config file. 13. Restart IIS to apply the custom policy to the specified virtual server. Download Sample Custom Policy File comes from:http://it.toolbox.com/blogs/sharepoint-blog/moss-2007-and-code-access-security-14357 Recipe for successful use of Content Deployment WizardSunday, 6 April 2008So my tool, the SharePoint Content Deployment Wizard has been available for some time now and I've been monitoring the feedback and issues people have raised closely. The current version is labelled 'beta 2' but I'm happy with the stability of the current codebase, so will probably re-label it as 'release 1.0' soon (following some feedback on the psychological aspect of the beta label :-)).Only a small number of people have raised issues, and any problems have almost exclusively been related to the underlying Microsoft code used by the tool rather than the Wizard itself. I should probably be happy about this, but in reality if some people get errors from the tool it doesn't really matter why it happens. The good news is that it seems Microsoft are finally getting some issues with the Content Deployment API sorted at their end. This is a key point in my list of guidance I'd give to anybody running into any errors from the Wizard. Note that the first two apply to use of standard Content Deployment using Central Admin also: Tip 1 - Service Pack 1 and hotfixes matter Service Pack 1 fixed many issues with Content Deployment. Unfortunately it also broke some things which had previously been fixed with pre-SP1 hotfixes. It took me a while to realize this, but it's definitely the case. Probably the most common issue in this area is the 'Violation of Primary Key' error. There are reports of being able to work around this by modifying versioning settings on certain libraries, but MS have now released a hotfix very recently which seems to solve the problem for good on SP1 environments. At the moment this is by special request only - the KB to ask for is KB950279. This forum thread discusses this, and it worked for us. Interestingly I spoke to Tyler Butler (Program Manager for Content Deployment) at SPC2008, and he indicated Content Deployment in SharePoint is likely to get "significantly more stable in the next 30-60 days". I'm guessing this hotfix is what he was referring to, or at least part of it. Tip 2 - always start from The official guidance currently states that Content Deployment requires that the target site has been created from the 'blank' site template - this is detailed in KB article 923592. However, a better way detailed by Stefan in the comments below is to create an empty site using the STSADM -o createsite command. This is not the same as a site created from the blank template, and is the safest way to create sites which will use Content Deployment or the Wizard. What this means is that even if you're creating a site based on say, the publishing site template in development, any other environments which you wish to deploy content to should be created in this way. Notably, for publishing sites the publishing Feature should also not be enabled for the first deployment - this will be taken care of for you when the first deployment happens. You'll receive the same 'object already exists' error otherwise. Tip 3 - pay attention to the 'retain object IDs' option Generally the right option here is to select that you do want to retain the object IDs, and this should be done from the very first deployment - the only exception is when moving webs/lists to a different part of the site structure (reparenting). However, it's important to note that mixing use of Content Deployment or the Wizard with STSADM export/import is likely to cause problems as noted by Stefan in his recommended 'Content Deployment and Migration API - avoiding common problems' post. A more comprehensive write-up of options available with the Wizard is available at 'Using the SharePoint Content Deployment Wizard'. Also note that's not it as far as the tool goes - in addition to extra functionality such as item-level reparenting and incremental deployment, I hope to refactor the code so that the Wizard would be scriptable from the command-line. And special thanks go to my colleague Nigel Price for working through the hotfix situation, much appreciated :-) Posted by Chris O'Brien at 21:04 The Long Path to Content DeploymentRecently I’ve had the pleasure to use the content deployment feature of MOSS between some of our SharePoint environments. It was not a smooth ride and I believe that I have now met every single obstacle and bug in that feature. This posting is the result of several months’ worth of frustration. We got three environments Dev, Test and Prod and we want to use content deployment to move content from the production servers to the development and test servers, simply to ensure current test data. As a side node, you might want to read the Microsoft brief “Team-based Development in Microsoft Office SharePoint Server 2007” for another good reason to make content deployment one of your skills. Well, without beating around the bush anymore the following are the steps needed to do a content deployment (with some minor obvious exceptions) in order of appearance. Setup pathContent deployment requires you to first setup a path and then one or more jobs for that path. Simply put the path is the server to server connection configuration, the job is a specification of what to do and when. I try to use security best practices so all my both service users are just standard domain users, any special rights they might need are assigned by MOSS during the configuration wizard. In the same vein my farm administrator accounts are standard domain users that are assigned extra permissions only through SharePoint. The first problem with creating a path is an access denied problem during the path setup page (/_admin/DeploymentPath.aspx), when you select the source web application and site collection. For the destination site collection you are required to provide an explicit user with sufficient rights.
Figure 1: The “Access denied” message It seems that your logged in user needs to be able to read the IIS metabase when you select a web application. There are many ways to grant access, I choose to add my farm administrator to the IIS_WPG local security group on the server. In my opinion the SharePoint team forgot to impersonate the call to read the IIS metadata. Will hopefully be fixed in some future service pack. The second problem (on the very same page) occurs if you connect to another farm using SSL (which you should!) – You get the exception “Requested registry access not allowed” when you submit the page. After some tracing I’ve learned that the problem is that the server tries to store the SSL key for your destination server in the registry hive for the system user, which is the correct one, but apparently the SharePoint configuration wizard tightened the security on the keys in question. To get around this: Grant your user (farm admin) membership to the local WSS_RESTRICTED_WPG security group and grant that group “full control” to HKEY_USERS\.DEFAULT\Software\Microsoft\SystemCertificates. You could also opt for granting your user direct access to the key. To sum it up:
That’s it! You should now be able to setup a path. Setup JobNext setup the job to your liking, choose whatever options you desire. Run the job. If it succeeds then stop reading now and save a few minutes of your time. No? Carry on then… Hotfix deploymentAt this point I got the following exception: User cannot be found. at Microsoft.SharePoint.SPUserCollection.GetByID(Int32 id) at Microsoft.SharePoint.SPWeb.get_Author() at Microsoft.SharePoint.Deployment.WebSerializer.GetDataFromObjectModel(Object obj, SerializationInfo info, StreamingContext context) at Microsoft.SharePoint.Deployment.DeploymentSerializationSurrogate.GetObjectData(Object obj, SerializationInfo info, StreamingContext context) at Microsoft.SharePoint.Deployment.XmlFormatter.SerializeObject(Object obj, ISerializationSurrogate surrogate, String elementName, Boolean bNeedEnvelope) at Microsoft.SharePoint.Deployment.XmlFormatter.Serialize(Stream serializationStream, Object topLevelObject) at Microsoft.SharePoint.Deployment.ObjectSerializer.Serialize(DeploymentObject deployObject, Stream serializationStream) at Microsoft.SharePoint.Deployment.SPExport.SerializeObjects() at Microsoft.SharePoint.Deployment.SPExport.Run() Looking like this:
Figure 2: Deployment error - no creator/owner of site The exception occurs fairly quickly during the preparation phase. It obviously indicates that a creator of a (sub) site it not to be found in the SharePoint user database. In my case it happened because the farm was originally deployed using a site collection backup/restore from another AD domain, the creators of various sites would then be users in the original SharePoint farm which would be unknown in the new (which is now my source). I suppose you might see this error if you deleted some users as well. There is nothing you can do about this error; Microsoft however, has a hotfix for this (which also solves a few other bugs). Hotfix number is 313183 and the knowledge base article you are trying to address is kb936867. At the moment of writing this is private hotfix that can only be obtained by contacting MS support. Sucks but there is a way at least. The hotfix solves a total of 11 bugs including one more in relation to Content Deployment entitled “Violation of PRIMARY KEY” – it seems I avoided one snag after all. Feature problemsNext error in line occurred right after the last during the export phase. I received the very informative exception: Failed to compare two elements in the array. Going to the source server I tried to pinpoint the error by running “stsadm –o export …” on the base site collection url (same error) and then the first level of sub sites (all exported fine). That command is exactly the same as a content deployment just without the transfer and import part on the destination end (you are responsible for transfer and then use the import command). The exception basically means that some of the features activated at the site collection level no longer exist on disk. Their feature definition files have probably been deleted. This can easily occur if you delete some features from your solution packs without deactivating/reactivating all features on deployment (and who cares to do that?). If you know exactly what features are the problem (might be more than you know) I suppose you might be able to reinstall, deactivate and then uninstall to fix the problem. You might also be able to create dummy features with the correct ids and then try to install, deactivate and uninstall. I did neither; code had to be written What you need to do is:
I wrote an aspx page for this that is installed as a feature in the Central Administration site:
Figure 3: My page to list and possibly remove features from web app / site / web Pretty cool In due time, I will clean up the code and publish another article about this administration feature along with a few others that I’ve developed and since found indispensable. Server Name ProblemFinally the export phase can be completed. Next problem is the transfer phase, which simply moves the exported files from the server assigned the task of performing the content deployment job to the destination server. In the path specification the location of the Central Administration site on the destination server is specified along with the destination web application and site collection. The source server tries to export the file directly to the destination server handling content deployment jobs, which might or might not be the same server that’s running the Central Administration site. It does so by resolving the FQDN (Fully Qualified Domain Name) of the server, which might very likely be a problem to you. If you deploy content between servers in separate network segments this won’t work out of the box, e.g. the source server can probably not find your destination server by the name “my_dest_server.my_domain”, which is only known within the immediate local AD domain of that server. There’s no reason to think too deeply about these names – just try to do a content deployment and if it fails during the transport phase it’ll report “The remote upload Web request failed” along with the name it’s trying to resolve. A similar event log entry is also created: Event Type: Error The remote name could not be resolved: ‘servername.dev.local’ For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. The fix is simple:
Feature problems – part IIWe’re now in the import phase and almost through. During the import SharePoint will check whether all the activated features at the source site collection (and sub sites) are also available at the destination site collection. If not you’ll get an informative error, similar to: “Content deployment job ‘Remote import job for job with sourceID = 71bb6ada-762c-4e78-8bc3-2a105bbe5988′ failed.The exception thrown was ‘Microsoft.SharePoint.SPException’ : ‘Could not find Feature xxxxxx.’ The solution is obvious – install the same solutions/features at the destination web application as on the source. Specified Name is already in useIf you get an error similar to “Content deployment job ‘Remote import job for job with sourceID = 71bb6ada-762c-4e78-8bc3-2a105bbe5988′ failed.The exception thrown was ‘Microsoft.SharePoint.SPException’ : ‘The specified name is already in use. A list, survey, discussion board, or document library cannot have the same name as another list, survey, discussion board, or document library in this Web site. Use your browser’s Back button, and type a new name.’“ You forgot to read the manual (ok, blogs) that specifies that the destination site collection should be a brand new blank site collection – in my case I tried to export to a newly created publishing site collection. The Small PrintFinally your content deployment ought to be complete If your site looks a bit strange it’s probably because the master page settings wasn’t copied, so you’ll have to assign the correct master page through the site settings. Might also be the case for the welcome page, though I haven’t confirmed it. During the export every file of your site will be copied to the deployment package so if any files have gone missing you’ll get appropriate warnings during the export, but it’ll still complete. This is actually a great way to detect if any aspx files have been deleted by accident, e.g. an AllItems.aspx page for a custom list might have gone missing if somebody changed the list definition (probably deployed within a feature). Phew! At least it works for me now… (Updated) Other bugsThis is a small list of other bugs I’ve heard/read about 1. (Thanks Harry!) The Cab-files are not always deleted and remain in the folder C:\WINDOWS\Temp\ContentDeployment. Regardless of the content deployment setting of the number of jobs to keep, they will not be deleted. Roll your own workaround and delete the files. You could schedule a job to delete everything older than 1 day (as I’m sure your job can complete in less time than that) And of course: Move the directory location to a non-system drive 2. (Thanks Harry!) Specific sites within the site collection: I select only the language-variations but not the root. After Test Job or Run Now the root has been always added to the Scope (Fix 937208 apparently solves the problem) 3. Some characters are mangled after deployment, specifically “nbsp;” in html fields (probably a lot of others too). Update: This has been fixed with hotfix 938536 (private hotfix for now - sorry) 4. Missing disk space on destination server will be reported (on the source server) as 5. If you choose to copy “all” security information between servers not in the same domain you might get the following error (copying role definitions only works fine) On hotfixes: Please note that hotfixes are cumulative and later numbers super seeds earlier ones - so the game is to get the highest number of all (Updated) Conclusion (sort of)Some of you have asked (in the comments) whether or not it all worked in the end. It actually did work! Great! So do we use it? No. We really really wanted to use this feature and all looked so well after our the latest hotfix deployment that we planned to use it for the existing publishing site as well as for a some additional upcoming site collections we’re developing. One particular annoying feature (sorry for the pun) is breaking the content deployment which I have yet to find a solution for. The new sites are based on custom site definitions and a number of features that creates custom content types and site columns from a number of xml files. Some of these site columns are lookup columns that which cannot be created with xml files the same way as every other site column, because they need to refer to an existing list by list id (in the xml file) but the list will be assigned a dynamic id by the system when it’s created (by another feature that the site columns is dependent on). To get around that problem a feature activation handled is executed that creates the lookup site columns using custom code that find the dynamic list id from the name. That code is roughly based on code found on codeplex (here). Some minor differences: I fixed some bugs with internal/display name mixup, reactivation problems and a missing “webid” (had to be dynamic as well) in the constructed field. The missing “webid” did cause content deployment to fail immediatly. For some reason I have yet to track down it now fails if the content type using one of the lookup site columns is in use, i.e. a list item of that type exists anywhere in the site collection. For lookup site columns created through the web interface there are no problems. Bummer. The choice we’re facing (barring that I manage to solve the problem before long) is 1. Either: We can define the content type through xml files 2. Or: we can use content deployment and create content types manually through the web interface - they will be copied as part of the content deployment) We chose the first option as content deployment at the current level of maturity seems too unstable. Furthermore we also decided to use only one strategy and therefore not use the content deployment for the first site collection that this article originally targetted (one where all content types where created through the web interface). How do we do it now? We use “stsadm -o backup/restore” to deploy new versions of the site. It’s essentially a database backup with all the benefits and drawbacks of such. It’s very stable. Specifically history of all items are maintained, you get a messed up user database where you’ll (eventually) find users from all environments, you need to explicitly set new ownership (to a valid user that can be found in the relevant environments AD), you get the luxury of copied security permissions sets and groups (which I might still build a tool to import/export). comes from:http://soerennielsen.wordpress.com/2007/06/19/the-long-path-to-content-deployment/ Functions for use in a MOSS 2007 column ([Today] [Me] [Other??])Following the recent questions from my last post I thought it would be useful to highlight what functions are available when creating a column in a list/library within MOSS 2007. This can be useful when creating a:
Although the [Today] and [Me] functions are well know, other functions are not. List of functions available All of the functions available are listed below. I have only tested a sample of these in a MOSS 2007 list, but in theory most/all should work!
To get a more detailed list of the functions available:
4. At the bottom of the list, click the Help hyperlink. This will open a chm file.
5. In the chm file, expand the Function Reference tree
The chm file may also be found at C:\Program Files\Microsoft Office\Office12\1033\STSLIST.CHM. Example use of a function Requirement = calculate the number of days difference between two date columns. 1. Make two date columns, one called Date1 and the other called Date2. 2. Make a third column (e.g. DateCalc) to calculate the difference and ensure the column type is set to Calculated. 3. In the Formula box type =DATEDIF(Date1,Date2,"D") 4. In the The data that is returned from this formula is section, click the Number radio button.
Result within a MOSS 2007 List:
Enjoy! Posted: Friday, March 28, 2008 5:30 PM by James Kemp MOSS 2007 : WSS 3.0 : How do you add a new Site Column to a Content Type using the MOSS object model?How do you add a new Site Column to a Content Type using the MOSS object model? Here is the sample code SPWeb web = new SPSite("http://localhost:4040").OpenWeb(); SPContentType myCT = web.ContentTypes["myNewContentType"]; myCT.FieldLinks.Add(new SPFieldLink(web.Fields["abc"])); myCT.Update(); Note : The following MSDN article speaks about “Updating Child Content types”. http://msdn2.microsoft.com/en-us/library/ms442695.aspx The example given in the article uses the SPFieldCollection object (SPContentType.Fields) to add columns to the content type. But when we use the sample given in the article we end up with the error message “SPException: This functionality is unavailable for field collections not associated with a list.”. I found that the columns are not added into content type and that are referenced in content type from the following article. http://msdn2.microsoft.com/en-us/library/aa543526.aspx Also the above article “How to: Reference a Column in a Content Type” says, The Fields property returns an SPFieldCollection object. Each SPField in this collection represents a "merged view" of the base column definition and any overwritten properties specified in the column reference in the content type. Because of this, you cannot add columns directly to this collection. Attempting to do so results in an error. Keep Coding... Published Monday, January 08, 2007 2:08 PM by Karthikeyan Advanced Search on your own metadataTwo of the great new things about MOSS2007 are Content Types and the extensibility of the Search function. Put the two together and very quickly you’ll come up with the scenario where you’ve created a nice comprehensive set of metadata which you’ve now applied to all the sites and libraries in your site collection, and now you want search on those metadata items. The Advanced Search web part (typically surfaced through the Search Centre) looks like it’s going to do the job for you, with a drop down box which lets you restrict your search based on properties, but out-of-the-box it quickly becomes apparent that only a subset of the standard properties are there, not your own site columns. The ones you get as standard are: Author Description Name Size (MB) URL Created Date Last Modified Date Created By Last Modified By There are a couple of additional steps which you have to carry out to make your own appear there, most of which have been documented in various places but I couldn’t find a complete end-to-end walk through for the process, so this is it. Firstly, I’ve assumed that you’ve already set up the site columns, assembled them as content types, and made those content types available within the document libraries of your sites. In my case, I have a set of them which form the core metadata schema for my customer – a mixture of default and bespoke ones. Contributor (multiline) default Date Created (date/time) default Disposal Action (choice) bespoke Disposal Date (date/time) bespoke Disposal Review (date/time) bespoke Document Type (choice) bespoke Relation (multiline) default Title (single line) default Topic (choice) bespoke Created By (person/group) default Modified By (person/group) default Checked Out To (person/group) default The problem comes about because within Sharepoint 2007 there are two types of properties – crawled and managed. Crawled properties are automatically extracted from crawled content, but users can however only perform queries over managed properties. Thankfully Sharepoint lets us map one or more crawled properties onto a managed property and then, after the next crawl, those properties become available. That description – one or more – is quite important as it permits an element of ‘fuzzy searching’ whereby the metadata category which the user wants to search on may be implemented in a number of different ways across different content types. This lets us hide that from the user. The place to start is Central Admin – Shared Services Administration – Metadata Poperty Mappings. This is where you can check whether the properties you want are already being managed, or whether you will need to add them. For my list above, the “Created By”, “Created Date” [aka “created”], “Title” [aka “DisplayTitle] and “Modified By” properties are present but the “Contributor”, “Disposal Action”, “Disposal Date”, “Disposal Review”, “Document Type”, “Relation”, Topic and “Checked Out To” ones will need to be added. NB It may also be necessary to check the existing ones and add any additional new crawled properties to the list. Adding them is really only a case of clicking the “new managed property” button, giving the property name (no embedded spaces allowed), a description, a type (text, integer, date, etc) and then deciding which crawled property (or properties) to map to. In my case I’m mapping as follows Managed Property Type Crawled Properties CreatedBy Text Creator Created Date/Time Office:12 Basic:15 DisplayTitle Text Basic:displaytitle ModifiedBy Text ows_ModifiedBy ows_Modified_0x0020_By Contributor Text _Contributor DisposalAction Text Disposal Action ows_Disposal_x0020_Action DisposalDate Date/Time ows_Disposal_x0020_Date DisposalReview Date/Time Disposal Review DocumentType Text Document Type ows_Document_x0020_Type Relation Text _Relation Topic Text ows_Topic Topic CheckedOutTo Text ows_CheckoutUser At this point it would be nice if they all just magically appeared in the advanced search dropdown list, but unfortunatley there’s one more step involving evil editing of config files. Go into your Advanced Search page and select Site Actions – Edit Page. For the Advanced Search Box webpart chose Edit- Modify Shared Webpart. In the “Properties” section there is a ‘properties’ dialogue box which, if you click into it, will give you the […] ‘builder’ link allowing you to edit the XML string. This string has four sections, two of which concern us. Between <LangDefs> and </LangDefs> it lists all the languages which can be used and between <Languages> and </Languages> it causes those languages to be displayed in the web part. We’re interested in the bottom two sections however. Somewhere between <PropertyDefs> and </PropertyDefs> we need to insert all of the Managed Properties we added above, following the format of the entries already there. So, for example, for our “DisplayTitle” property, we add the line <PropertyDef Name=”DisplayTitle” DataType=”text” DisplayName=”Title”/> Finally, in the section between <ResultTypes> and </ResultTypes> we need to show which result types we want our results to show up in. So assuming we want our new results to show up everywhere, we find the subsection between <ResultType DisplayName=”All Results” Name=”default”> and </ResultType> and add in the line <PropertyRef Name=”DisplayTitle” /> Exit the “modify web part” process and publish the page if necessary. Creating Application Pages (_layouts) in MOSS 2007 - How to do rapid development using Form Field Controlsby Oscar 1/29/2008 4:22:00 PMAs you may or may not know, there are thousands of ways to accomplish development and customization tasks in MOSS 2007 and WSS 3.0.
|
|
|