Sharepoint 2013 Document last modified date code snippet - sharepoint

I am using sharepoint 2013. I have a page that does not show the document library itself, but has links to documents within it. Next to the link I would like to show the date the document was last modified for each file. See image
The text is not a link, just the PDF is a link to a file with in a document library. They are not all in the same library though, some are on other sharepoint 2013 sites, that I own as well.
Is this even possible? I have been searching for a few days, but have not found anything close to what I am looking to do. Most of what I am finding is related to getting the date in applications outside of sharepoint.

Yes it is possible depending upon the SharePoint api you use and the location of documents.
If using SharePoint JSOM, its possible if all the sites in which documents are stored are is same site collection.
If using SharePoint object model and using correct privileges, there's no limitation whether the documents are is same or different site collections (you may have to use different context objects though)

Related

Can I restrict document types uploaded to a Sharepoint Online Document Set?

I have created a Document Set in SharePoint online and allowed the Document content type to the document set.
Is it possible to restrict the types of documents uploaded to the document set? I only want users to be able to upload Word 2007 documents and above and not any older versions of Word documents such as Word 2003.
Not sure if it is possible or not? I can't see of a way to restrict this from the content type or document set.
This is not possible using Out Of The Box (OOTB) SharePoint. I am assuming you don't have access to Central Administration.
Event handlers are a common approach but you need to a have good reason to incur the technical debt involved.
Here are some discussions of options on how you can do this if you really feel it is worth the risk and trouble.
https://sharepoint.stackexchange.com/questions/1039/how-to-restrict-a-document-library-to-a-specific-file-type-extension
https://social.technet.microsoft.com/Forums/windows/en-US/313c37ca-62cd-434f-9fe8-3eacc4044a63/can-we-restrict-specific-file-type-uploading-on-sharepoint-library?forum=sharepointgenerallegacy

List of documents in Entire Sharepoint Site

I am trying to get a list of all documents within my SharePoint Site, owner and date last modified.
It is a SharePoint 2010 Enterprise environment.
It's a site which has many subsites.
All solutions I have tried only allow me to get documents at that specific site level and not subsites.
I must admit, I can get the required information by querying the SQL DB directly but don't want to go down this path, as it's unsupported by MS
Any help would be appreciated.
You can get this information quite easy by using Powershell, you just need to iterate through all subsites and document libraries.
Take a look at these pages:
http://blog.falchionconsulting.com/index.php/2010/08/getting-an-inventory-of-all-sharepoint-documents-using-windows-powershell/
(This is almost exactly what you require, there are a few extra lines that you don't need).
http://www.sharepoint-journey.com/get-all-document-libraries-in-a-site-collection.html
https://sharepoint.stackexchange.com/questions/126397/powershell-get-a-list-of-all-the-document-libraries-for-a-web-application-incl
http://blogs.msdn.com/b/varun_malhotra/archive/2012/02/08/sharepoint-2010-powershell-download-all-files-in-document-library-to-network-share-file-share.aspx

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.

XsltListViewWebPart with CrossList

i'm new to SharePoint, and i'm working with sharepoint 2010.
I'm trying to create a webpart on SPdesigner that holds a XsltListViewWebPart
which is linked to a custom library i created in the Site Collection.
I want to list all the documents related to current user from the all sites
under the site collection.
to do so i set the DataSourceMode from "List" to "CrossList"
but then the webpart doesn't show any document as seen in the image below
(its like there is a line but the data is not showing..)
Does any one know what the reason for this?
How can I fix it to work so the webpart will list all docs from all sites in collection?
First, is there any reason why you don't use the out of the box Relevant Documents Web Part?
I don't think the xslt List View Web Part works in crosslist mode. What you'll need to do is use a Data View Web Part.

Search A For A Document Library or Document In a Document Library in Sharepoint

I am new to Share Point. I created a Document Library and added a number of documents to that library. When I use the "Search" feature, I enter the exact name of a document in that document library, but I contiue to get no results. I don't understand why? Thank You!
Your administrator must enable searching for your SharePoint site collection. Also, they must setup and make sure the SharePoint search service is running.
Here is another SO thread where they ask a similar question: How to enable search in documents in SharePoint 2010?
The answer points to this article: http://sharepoint.stackexchange.com/questions/3531/sharepoint-2010-search-not-working

Resources