cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically generate smart folders

jonvargas
Confirmed Champ
Confirmed Champ
Hello.

We have been able to use Smart Folders to filter by type, status, content type and so on, that's okay. However we may face the following scenario:

The company has a type of folder named "Case Folder". This is a subtype of cm:folder and we added the "Case ID" property. The also have an aspect named "AssociatedToCase" which has a property named "relatedCase".

As you may see, the idea is just to related content files across the repository to cases, using their Case ID.

So, we want to create a Smart Folder named "Content by Case ID", so that it will display a list of folders for each available "Case ID", and inside each case folder there, display all content which has its "relatedCase" property set to the case id .

This way, we can group all content related to a particular Case ID into a single folder.

The smart folder structure would look like:


\Cases by ID
  \Case 1 (smart folder)
    \Physical file with relateCase set to "Case 1"
    \Physical file with relateCase set to "Case 1"
    \Physical file with relateCase set to "Case 1"
  \Case 2 (smart folder)
    \Physical file with relateCase set to "Case 2"
    \Physical file with relateCase set to "Case 2"
    \Physical file with relateCase set to "Case 2"
  \Case 3 (smart folder)
    \Physical file with relateCase set to "Case 3"
    \Physical file with relateCase set to "Case 3"
    \Physical file with relateCase set to "Case 3"
   \Case N (smart folder)
    \Physical file with relateCase set to "Case N"
    \Physical file with relateCase set to "Case N"
    \Physical file with relateCase set to "Case N"
  \ …


Is it possible, which would be the recommended approach?
1 REPLY 1

art99trash
Star Contributor
Star Contributor
Could you implement this through rules?

For example,
1. When a file is created, run a javascript that would check the "relatedCase" value and, if the related "Smart Folder" did not exist, create it, then copy the file into that folder
2. When a file is updated, run a javascript that would check the "relatedCase" value, then copy the file into the related "Smart Folder" (or, if the "relatedCase" value has changed,
    move the copy into the correct folder.

This is a very high level description but I think you get it to work this way.

Another option might be to use dynamic constraints.