SharePoint 2010 - workflow to copy files from one sharepoint farm to another - sharepoint

Seemingly simple requirement. We have two SharePoint web applications hosted on the same server. Site A is used internally and is thought of as hosting the source documents. Site B is accessed by external suppliers.
I would like to have SharePoint automagically copy new documents from a doc library in Site A to a doc library on Site B. It would need to preserve metadata. The process would need to "fire" each time a new document was uploaded into the document library in Site A.

Why are you looking for workflow solution in this case?
Go for Item Added event receiver for that document library.
Use managed client object to copy the document to library in another farm.

Related

What's the best way to update SharePoint document content via .NET?

I have the URL of a SharePoint (2013) document and also the path to a network document.
(Both the SharePoint document and the network document can be very large. In this specific case, the SharePoint document is an image-only PDF and the network document is a text-searchable version of the same document.)
I want to update the content of the SharePoint document with the content of the network document.
What is the best way to do this in .NET?
(I'm trying to avoid adding a new document to SharePoint, because of document ID considerations.)
Thanks!
There are several issues you have to tackle. 1) SharePoint must be configured to accept large files, 2) IIS must be configured to handle large requests, and 3) IIS must be configured to wait long enough for the upload to complete.
To configure SharePoint to accept large files, change the Maximum Upload Size for the web application in Central Admin.
To configure web limits in IIS, check out the Microsoft documentation at iis.net. (www.iis.net/configreference/system.applicationhost/weblimits).

Sharepoint 2010 - Questions regarding basic concepts

I am beginning sharepoint development and have some quick questions concerning basic terms.
How do i find out whether a particular site is a site collection, or a site JUST BY THE URL? Is their a powershell command to do this?
I was creating some sites in sharepoint. Some sites were appended with /sites/sitename whereas others were just under the base url of sharepoint. What is the difference between the 2? AND, how do i recreate the ones under the sites node? For some reason, I cant find the option to create under the sites node again. Please explain this concept as all msdn tutorial are very confusion for beginners like me. Those are good once you get the hang of basics.
Please provide an analogy how to understand web app, site collection, site, web site, etc.
Is there a way to use NEWFORM.aspx for a document library instead of UPLOAD.aspx?
The Site collection is at the root level of your Web application.
So http://abc.com/ => Site collection
Using Powershell, open the Sharepoint Powershell prompt and run Get-SPSite to get all Site-Collections
the /sites/ is called as a managed path
It can be defined in the Central Administration for every web application.
The option to select the /sites will be available only when you create the second site collection under the Web Application (The first one take the / by default.)
Have a look at Technet Article
document library is for uploading file, not for storing user submitted data, for that you need to create a list
1) Document Set is used in cases where multiple documents have the same properties, its like putting all these documents in a folder and then providing attributes to that folder which are in turn applied for each document in that folder.
In your case, if all the files have the same values for the 8 fields then the document set is the correct way to go.
2)If there is additional metadata associated with the files then these can be added either to the content type (eg. document or document set content type) or to the columns in the library itself, you dont need to create a separate list for holding that data. Adding data to the content type ensures consistency across all the document libraries within that site collection, adding columns to the library affects only that library.

Sharepoint 2010: Copy or add file to Document Library

I have a silverlight application inserted in a SharePoint page. The SilverLight application runs on a different server thatn that of SharePoint. From an event in the SilverLight, I generate a document on the server side from SQL Server. I can generate the doc on the server hosting the silverlight application and also copy it to the SharePoint server. I wanted to know if I can include this file in a sharepoint document library automatically. I was thinking if like emailing to a list allows us to copy the file into the library, can we configure the reverse, means copying the file make it part of the list.
Update:
I wanted to avoid uploading. For me uploading is sending the file from one location to the target location. But what I am saying is, if I copy the file into the folder where SharePoint keeps the file physically for the particular list, can it be added to the list automatically?
I am not sure, how well I am being able to describe the point. Please elaborate if required or I can answer your queries.
SharePoint stores the files in a database, not a folder.
WebDAV access may be what you're looking for - it's a backbone of the the Explorer View feature that allows a user to access a document library as if you were accessing a file system through a Windows Explorer window.
You can configure "incoming e-mail" properties for the document library, and assign an e-mail address.
After that, when you e-mail a document as attached to e-mail to this e-mail address, then attachment will be saved to that library by sharepoint automatically.

Create EventReceiver when new site collection is created in SharePoint 2010?

I need a way to execute code when a new Site Collection is created. I've looked at creating a web-scoped FeatureReceiver that gets executed when a new Web is created. Then stapling this feature to all the site definitions, however Visual Studio 2010 isn't letting me deploy the module that contains the FeatureSiteTemplateAssociation directive. It complains that the feature can't be deployed farm level (because it contains a Module).
Any ideas?
It sounds like you might want to use an Event Receiver instead of a Feature Receiver. There is only an event for determining if a site collection is deleting/deleted. There is an event for Web Adding/Provisioned however. If you are creating a site immediately after creating the site collection one of those 2 events could be used to simply check the count of webs in the collection (0 or 1 depending on which web event receiver you use). This would essential run your code on the creation of the first site within the site collection and should accomplish what you are looking for.

Programmatically access a SharePoint document library?

How would I programmatically access a SharePoint document library from another machine? I want to recursively scan all the folders and generate a list of files with a certain custom property.
You'll need to use the List Data Retrieval web service. Example code using the service can be found on the Query method page.
Vinny is correct. I just wanted to elaborate a little on the next version of SharePoint, SharePoint 2010. There are several client based models for access that essentially wrap the web service calls. There is a managed .NET dll for Windorm/WPF applications, a library for use within websites that is JavaScript based and a Silverlight based implementation.
This MSDN article has links to more information on all three.

Resources