Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
7 subscribers
Views
2631 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Is there a OOTB functionality to empty the contents of KC or to get all the top
sikhivahans
over 10 years ago
Is there a OOTB functionality to empty the contents of KC or to get all the top level folders present in KC?...
OriginalPostID-121528
OriginalPostID-121528
Discussion posts and replies are publicly visible
Parents
0
Eduardo Fuentes
Appian Employee
over 10 years ago
1. You can use the Content Functions as an example to create your own custom function plug-in to retrieve all folders from a KC. Here's an example:
@Function
@FolderDataType
public Long[] GetAllFoldersFromKC(ServiceContext sc, ContentService cs, @Parameter(required=true) @KnowledgeCenterDataType Long knowledgeCenter) {
ContentFilter cf = new ContentFilter(ContentConstants.TYPE_FOLDER);
return cs.getAllChildrenIds(knowledgeCenter, cf, ContentConstants.GC_MOD_NORMAL);
}
2. Then you can pass the result of calling this function to the Empty Folder smart service available in the second plug-in from my post
3. You can now use the Delete Folder smart service to delete the empty folders that function #1 will return.
Or you can merge these three things in your own custom smart service called "Empty KC"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Eduardo Fuentes
Appian Employee
over 10 years ago
1. You can use the Content Functions as an example to create your own custom function plug-in to retrieve all folders from a KC. Here's an example:
@Function
@FolderDataType
public Long[] GetAllFoldersFromKC(ServiceContext sc, ContentService cs, @Parameter(required=true) @KnowledgeCenterDataType Long knowledgeCenter) {
ContentFilter cf = new ContentFilter(ContentConstants.TYPE_FOLDER);
return cs.getAllChildrenIds(knowledgeCenter, cf, ContentConstants.GC_MOD_NORMAL);
}
2. Then you can pass the result of calling this function to the Empty Folder smart service available in the second plug-in from my post
3. You can now use the Delete Folder smart service to delete the empty folders that function #1 will return.
Or you can merge these three things in your own custom smart service called "Empty KC"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data