0

This 'Files List' component in Communities is pretty nice. But I would like to create a modified version.

Content Data Model

Could anyone help with the queries or filter criteria? Ill be working on them also. Ill post later as I get them, and hopefully replicate this component with the ability to customize it.

The queries

  1. File Owned by Me
  2. Files Shared with Me
  3. Recent Files (Query 1, then sort by date, and take top 5?)
  4. Files Im Following
  5. List of Libraries I can access
  6. Files within a Library

Im guessing #1 is similar to (Select Id, Title, FileExtension, CreatedDate From ContentDocument).

enter image description here enter image description here

2 Answers 2

3

These queries will involve different tables. I'll provide general information in this reply, but please let me know if you need additional assistance.

File Owned by Me

Query ContentDocument where owner= <running user id>

Files Shared with Me

Query ContentDocumentLink where LinkedEntityId = <running user id> and ShareType != 'I'

You want to exclude "I" ShareType because that would represent the user is the owner

Recent Files (Query 1, then sort by date, and take top 5?)

Query RecentlyViewed where id starts with '069'

Files Im Following

Query EntitySubscription where the parentId starts with '069'

List of Libraries I can access

Query ContentWorkspace

Files within a Library

Query ContentDocumentLink where LinkedEntityId in (<set of workspaceIds from querying ContentWorkspace)

1
  • I had a couple of them, but your conditionals also helped(excluding 'I' type). Linking to the APIs is great as well for anyone that follows down the road. I had never come across RecentlyViewed or EntitySubscription. Thank you!
    – ATA1k
    Commented Mar 1, 2017 at 20:40
0

First : Query on ContentWorkspace SELECT Id, Name, Description FROM ContentWorkspace

To Get all : SELECT Title,Id FROM ContentVersion WHERE ContentDocumentId IN (SELECT ContentDocumentId FROM ContentWorkspaceDoc)

and then Add the Name SELECT Id, Name, Description FROM ContentWorkspace where Name ='Test Documents'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .