How to identify document in SharePoint - sharepoint

You can put your documents in SP - cool, but, when its time to reorganize folders structure what I should do with old links?
Is there a way how to identify document instead of using URL where path to the document is used? I need something like permanent link: http://mysharepoint/doc-123, where 123 is the document identifier.
I need URL to the document which doesn't depend on folders where the document is published. Are there solutions?

SP2010 will offer a unique per site collection identifier for each document that you can use with a built-in redirector service.

You can use an URL Shortener solution and combine it with a SharePoint (Designer) Workflow or Event Receiver.
I have worked on a product that can be used in combination with SharePoint and can be used via web services, workflows as well as the user interface.
As your need is quite specific you may need to do a little bit of extra coding. If you don't have access to Visual Studio or prefer to use SharePoint Designer workflows for everything than have a look at the Workflow Power Pack.

You can create database table that contains the mapping to the files (you'll need to update there when the file changes)
the table should contain url wanted to route | url destination
then you could implement an HttpModule that reads that url and then redirects to the one in the table, however that will cost you overall performance so you could create a pattern and only do that when it matches the pattern.

In SharePoint 2007 you could create a redirecting page that takes the unique id of a document as query parameter. Use this id to get the document SPContext.Current.Web.GetFile(id) and redirect the response with the file url.

Related

How to track all changes inside a sharepoint site

I would like to know whether there is any api to get all changes inside a sharepoint site. I've done research in sharepoint and found out that changes api retrieves changes inside a list. I would like to get relative urls or unique id's of files changed inside a sharepoint site with or without supplying a change token. Please help.
have you checked out 'auditing'? It's an OOTB way to track changes on files, lists, librarys etc...
https://support.office.com/en-us/article/Configure-audit-settings-for-a-site-collection-f5a346d0-ee0f-4412-a5e6-d9b5abaa1012
Otherwise i would suggest to write event receivers and store the changes yourself in a database table for performance.

Sharepoint Search 2013 - is there any way to index a list of URLs stored in a database?

I have a database table with a list of URLs that I would like Sharepoint Search 2013 to index so they show up in search results - the URLs are a mixture of content types - web pages, Word documents, PDFs, etc.
All the URLs are internal to my network but aren't Sharepoint pages or files stored in Sharepoint.
I am using Sharepoint 2013 Enterprise Search on a Windows 2008 R2 server.
Does anyone have any ideas on how to achieve this?
I have searched for options but can't seem to find anything relevant - BDC and BCS have come up a lot but seems to be more indexing content returned by the connector. What I want to do is to use the data returned from the table as pointer to items to be indexed.
I'm very new to Sharepoint and Sharepoint Search and am at a bit of loss on how to go about this (to make it even more difficult I would like to apply ACLs to the results, and the ACLs are in another table but that's another question!). Given my experience level I would like the answer to be as basic as possible if you can, but any help would be apprecieated.
BDC and BCS is the proper way to do it, but it's very complicated. If you want something simple, create a small script that writes all the URLs to a single HTML document. Then use the web crawler to crawl this document. It will follow the links and crawl the content.

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.

Best Practices to add meta data to a site in SharePoint Foundation 2010

Scenario
I want to create a SharePoint sites (dynamically) for a number of events. Each event has a corresponding ID associated with it along with other corresponding fields. Each site will have a number of custom web parts that will need to reference those fields, particularly the ID.
When I create the sites dynamically, I need to assign that ID to the site so that the web parts "know" which site it is. I could always parse the URL (the ID is in the URL) but I would prefer a more elegant solution.
Any best practices or ideas out there that you have done to achieve this?
You can store custom Key-Value pairs in Property Bag of the site (SPWeb). It is simple to use as well.
Check it out: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx
You could use a list on each web to store the information in. This would make it easier for you to aggregate the infomation later on using CrossListQuery techniques.
The downside of this approach is that listitems are slower to access than property bags.

SharePoint - Using a Content Query Webpart across site collections

This is quite a simple question to ask, hopefully the answer is as straight forward! Can you use a Content Query Webpart on Site Collection A to read data from Site Collection B?
If it's not supports right out of the box, are there some configuration options which you can use to make it happen?
Thanks.
No configuration option will enable you to have a cross site content query webpart.
You can either create a custom web part that will do it or buy one (several options out there, here is one
If you decide to create your own web part, you will easily find code online that will help you. Here is an example.
No, it must be within the same site collection as it uses the SPSiteData query, which works within the site collection

Resources