• 3 replies
  • Latest Post - ‏2014-11-24T16:00:28Z by dorothea
59 Posts

Pinned topic [ICN 2.0.1, ICM 8.4] - Refresh search results after document import

‏2013-04-30T09:55:08Z |


I would like to know if it is possible to trigger a refresh of the currently displayed search results (same behaviour as pressing the "Refresh" toolbar button) after a document import via the "Add Document" default action.

I know this requirement makes sense only if the imported document is also a match for the search criteria currently set in the search form (otherwise the content list displayed will not change upon refresh), but the customer thinks it is nevertheless important, and I can't figure out what the simplest way to achieve it could be.

If possible, I would like to avoid having to code a custom plugin action to handle the whole "add document" functionality, just to add a refresh of the content list at the end...

Thanks in advance for all the help,


  • Alessandro.Damiani
    59 Posts

    Re: [ICN 2.0.1, ICM 8.4] - Refresh search results after document import


    I have found a solution for this, but I got there through "trial-and-error", so I would like to submit it here to understand if it makes sense.

    lang.setObject("myAddDocumentPluginAction", function (repository, items) {

            _addContentItemDialog = new AddContentItemDialog();
            // open the help file in a popup window:
  , null, true, null, function() {
                var container = dijit.byId("ecm_widget_listView_ContentList_0");
                //alert("List View: " + container);
                if (container) {
                    var resultSet = container.getResultSet();
                    if (resultSet) {
                        if (resultSet.getParentFolder && resultSet.getParentFolder() && resultSet.getParentFolder().isInstanceOf &&  resultSet.getParentFolder().isInstanceOf(ecm.model.ContentItem)) {
                        } else {
                    } else {
                        if (repository) {
                        } else {

    What I did was define a custom plugin action, and instantiate the default ecm.widget.dialog.AddContentItemDialog widget from within my action js code.

    Then I added my own callback (I saw in the AddContentItemDialog code that the callback passed to the "show" method is invoked only if a new item is actually added), with the code to refresh the content list in it.

    The whole thing seems to work as desired, I would just like to know if this approach is supported.

    Also, I sort of "guessed" what the parameters to the "show" method should be, because I wasn't able to locate the call to the show method made by the default "Add Document" button, so there might be something wrong there, too...

  • damorris
    825 Posts

    Re: [ICN 2.0.1, ICM 8.4] - Refresh search results after document import


    So in the Search view or the Browse view?  The Browse view already does this.  In the search view it would be pointless unless the document added matched the criteria.  Anyway, since the Browse view does this it's already you can just take a look there to see how it's done.

  • dorothea
    1 Post

    Re: [ICN 2.0.1, ICM 8.4] - Refresh search results after document import


    I developed in browser an action on document level: copy document. after exit from services I am calling as follwo the refresh of the desktop but the content listview of desktop is not refreshed, respectivelly no new document is displayed in the list.

    [ "dojo/_base/declare",
            function(declare, Action, Request, Desktop, ....

               return declare(
                        [ Action ],

    performAction : function(repository, itemList,
                                    callback, teamspace, resultSet, parameterMap) {

    at the end I can see in firebag the new docid and that is successfully created the new document:

 "new guid: " + respJSON.comment);
                                        Desktop.fileIntoFolder = true;
                              "Desktop.file in folder - called ");
                              "Desktop.refresh selected folder - called ");
                              "onChange(itemList 0 ");


    Please help

    thank you