Sladescross's Blog

Blogging about Sharepoint related stuff

How not to get the SharePoint version September 30, 2012

Filed under: RPC,SharePoint Version,SHTML.DLL,Version — sladescross @ 4:42 pm

http://www.wictorwilen.se/sharepoint-mythbusting-the-response-header-contains-the-current-sharepoint-version

Note: SharePoint Designer uses a call to /_vti_bin/shtml.dll/_vti_rpc to find out the version number

 

FrontPage SharePoint RPC API Call April 23, 2012

Filed under: FrontPage RPC,RPC,SharePoint RPC — sladescross @ 11:40 am

http://msdn.microsoft.com/en-us/library/ms442469.aspx

Frontpage/SharePoint Remote Procedure Call API

 

Blocking SharePoint Designer Per Web with Property Bag Change

Filed under: Block,RPC,Sharepoint Designer — sladescross @ 10:42 am

http://www.iwkid.com/blog/Lists/Posts/Post.aspx?ID=64

From there I added a new property matching the existing “vti_” pattern, using the property name we found in the Open Service method’s response:

The third RPC call (the one to author.dll) is the one we’re most interested in: it calls the Open Service FPRPC method. The response we get is almost 3kb of ALMOST-html garble (thanks again, Vermeer). Hidden in the response is a familiar attribute with a new name – vti_disablewebdesignfeatures2 with a value of wdfopensite:

 

Remote Access Alternatives Using SharePoint January 29, 2012

http://blogs.msdn.com/b/stcheng/archive/2008/12/17/wss-use-rpc-protocol-to-access-wss-v3-site.aspx

RPC examples.

Trace SharePoint Designer

http://sharepointinterface.com/2009/12/28/sharepoint-webdav-and-a-case-of-the-405-status-codes/

Interesting problem with WebDav calls not working because IIS7 had web dav publishing enabled.

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17481#instructions

GetUsage BLOB RPC call.

http://sharepointfieldnotes.blogspot.com/2009/09/uploading-content-into-sharepoint-let.html

(1) Copy.asmx file upload.

Byte array can have contiguous memory allocation problems on the server.

(2) WebDav (WebClient) file upload

No metadata can be uploaded.

(3) RPC (FrontPage) file upload

However, it does not support sending any metadata long with the file content. This can be a major problem if the document library has multiple content types, so the new file will be put into the document library with the default content type. Another big issue is if the default content type has required fields. The file will remain checked out until the fields are populated. This prevents other users from seeing the document or from being returned in any searches.  It is a great solution if you are just bulk migrating data from an external data store to SharePoint. You more than likely will have to do extra work afterwards. Adding metadata after uploading will also cause the creation of extra versions of the document being created unnecessarily. The fact that it does not use the soap protocol but straight http makes it more scalable than the copy web service. Unfortunately, it still suffers from the fact that it uses a byte array to upload the file. So sooner or later you will run into “out of memory “ exceptions.  So how can I create a folder before using WebDav?  You can use the lists web service to accomplish this:

 

Content Deployment API and Moving Document Library July 23, 2011

Filed under: Content Deployment,Content Deployment API,Copy Document Library,RPC — sladescross @ 9:31 pm

http://geekswithblogs.net/AnneBougie/archive/2009/01/23/copy-a-sharepoint-list.aspx

An example of code for copying a list and list items though no security. No content types.

http://rajeshagadi.blogspot.com/2011/04/how-to-programmatically-copy-web-level.html

Supplement the content deployment api by copying the security data as well.

http://rajeshagadi.blogspot.com/2011/04/drawbacks-of-current-list-export-and.html

Security defect with the content deployment API.

http://blog.mediawhole.com/2007/12/copying-sharepoint-document-library.html

Here’s the code I ended up with to copy the
contents of the Documents list in one sub site to the Documents list in another
sub site within the same web application:

Including a delete at 0 loop technique.

http://geek.hubkey.com/2007/12/move-sharepoint-document-library-files.html

RPC technique for moving document library items.

http://blogs.technet.com/b/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-1.aspx

Sharepoint content deployment API.

http://blogs.technet.com/b/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-2.aspx

Details of Sharepoint content deployment API for export.

http://www.sharepointmonitor.com/2010/08/sharepoint-server-2010-content-migration/

stsadm for content migration.

http://blogs.technet.com/b/stefan_gossner/archive/2007/08/30/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-3.aspx

Import to a different subweb.

Method 1 – all orphaned objects should be imported into the same sub web

This method will only work if all items need to be added to the same sub web. E.g. if you have exported a couple of lists and document libraries (even from different source webs) and now would like to import them into the same sub web.

SPImportSettings settings = new SPImportSettings();
settings.SiteUrl = “http://localhost:2001″;
settings.WebUrl = “http://localhost:2001/MyDestWeb”;
settings.FileLocation = @”c:\export”;
settings.FileCompression = false;
settings.RetainObjectIdentity = false;

SPImport import = new SPImport(settings);
import.Run();

There are two important settings that are required to get this working:

  • WebUrl – this property defines the web that will be used as the new parent for all orphaned objects in the export package. This method (e.g.) cannot be used if the package contains orphaned documents as a web cannot be the parent of a document. The parent of a document needs to be a list or a folder.
  • RetainObjectIdentity – this defines whether to preserve the object identity during import or whether not to preserve the identity. If the value is false the objects will get a new generated Guid during import and it will be possible to assign a new parent to the imported orphaned objects.

http://blogs.technet.com/b/stefan_gossner/archive/2007/10/12/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-5.aspx

Name GUID conflict with RetainObjectIdentity

http://blogs.technet.com/b/stefan_gossner/archive/2008/04/11/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-6.aspx

2) Ensure that sufficient disk space is available

This sounds like a simple prerequesit but it isn’t. Content deployment uses different places to store the extracted and compressed files. The compressed files are stored in the location you can configure on the “Content Deployment Settings” page in the “Temporary Files” row.

But before export creates the compressed files it first exports everything into a temporary directory. And this directory is placed inside the directory which is configured in the TMP environment variable of the user the Windows SharePoint Services Timer service (OWSTIMER.EXE) runs on (usually refered to as farm credentials). Per default this variable has the following value: “%USERPROFILE%\Local Settings\Temp” which is usually on your system drive.

Impact: So per default MOSS content deployment requires the disk space for the uncompressed exported files on your system drive!

How to resolve: The easiest way to resolve this is to logon to the machine with the farm credentials and adjust the TMP variable to point to a different location. Afterwards you would need to restart the OWSTIMER service.

http://blogs.technet.com/b/stefan_gossner/archive/2010/05/24/deep-dive-into-the-sharepoint-content-deployment-and-migration-api-part-7.aspx

Sharepoint 2010 can use snapshots for content deployment.

http://msdn.microsoft.com/en-us/library/aa981161(v=office.12).aspx

Comprehensive example including versioning and security.

SPExportSettings exportSettings = new SPExportSettings();
// Turn on extra output for testing
exportSettings.CommandLineVerbose = true;
// The name of the file targeted by the export
exportSettings.BaseFileName = “export.cmp”;
// The directory on the file system in which
// to put the exported package
exportSettings.FileLocation = @”%temp%”;
// If the file exists, overwrite it
exportSettings.OverwriteExistingDataFile = true;
// Export all security settings; change this if needed
exportSettings.IncludeSecurity = SPIncludeSecurity.All;
// The URL of the site being exported
exportSettings.SiteUrl = sourceUrl;
// The last major and minor versions
exportSettings.IncludeVersions = SPIncludeVersions.LastMajorAndMinor;
// Compress the exported file
exportSettings.FileCompression = true;
// Create a new export object with the correct settings
SPExport export = new SPExport(exportSettings);

http://sharepointnomad.wordpress.com/2009/12/30/calling-stsadm-from-within-a-powershell-script/

Calling stsadm from Powershell.

 

 

 

 

 

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers