/*
 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 */

package org.nuxeo.ecm.automation.jsf.operations;

import org.nuxeo.ecm.automation.core.Constants;
import org.nuxeo.ecm.automation.core.annotations.Operation;
import org.nuxeo.ecm.automation.core.annotations.OperationMethod;
import org.nuxeo.ecm.automation.jsf.OperationHelper;

/**
 * @author <a href="mailto:td@nuxeo.com">Thierry Delprat</a>
 */
@Operation(id = RefreshUI.ID, category = Constants.CAT_UI, requires = Constants.SEAM_CONTEXT, label = "Refresh",
        description = "Refresh the UI cache. This is a void operation - the input object is returned back as the oputput")
public class RefreshUI {

    public static final String ID = "Seam.Refresh";

    @OperationMethod
    public void run() {
        OperationHelper.getContentViewActions().resetAllContent();
    }

}

@@ -388,16 +388,51 @@
 tions;%0A%0A
+import org.jboss.seam.core.Events;%0A
 import o
@@ -633,32 +633,414 @@
 ion.
-jsf.OperationHelper;%0A%0A/*
+core.annotations.Param;%0Aimport org.nuxeo.ecm.automation.core.util.StringList;%0Aimport org.nuxeo.ecm.automation.jsf.OperationHelper;%0Aimport org.nuxeo.ecm.webapp.helpers.EventNames;%0A%0A/**%0A * Operation that:%0A * %3Cul%3E%0A * %3Cli%3Erefreshes the content view cache;%3C/li%3E%0A * %3Cli%3Eraises standard seam events to trigger refresh of most seam component;%3C/li%3E%0A * %3Cli%3Eraises additional configurable seam events.%3C/li%3E%0A * %3C/ul%3E%0A 
 *%0A *
@@ -1214,24 +1214,16 @@
 efresh%22,
-%0A       
  descrip
@@ -1417,115 +1417,732 @@
     
-@OperationMethod%0A    public void run() %7B%0A        OperationHelper.getContentViewActions().resetAllContent();
+/**%0A     * Additional list of seam event names to raise%0A     *%0A     * @since 5.4.3%0A     */%0A    @Param(name = %22additional list of seam events to raise%22, required = false)%0A    protected StringList additionalSeamEvents;%0A%0A    @OperationMethod%0A    public void run() %7B%0A        OperationHelper.getContentViewActions().resetAllContent();%0A        Events.instance().raiseEvent(EventNames.DOCUMENT_CHANGED);%0A        Events.instance().raiseEvent(EventNames.DOCUMENT_CHILDREN_CHANGED);%0A        Events.instance().raiseEvent(EventNames.DOMAIN_SELECTION_CHANGED);%0A        if (additionalSeamEvents != null) %7B%0A            for (String event : additionalSeamEvents) %7B%0A                Events.instance().raiseEvent(event);%0A            %7D%0A        %7D
 %0A   

make the 'refresh ui' operation raise seam events