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

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)

  • 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 Mar 1 '17 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.