1 package com.opensymphony.webwork.config_browser; 2 3 import com.opensymphony.xwork.ActionSupport; 4 import com.opensymphony.xwork.config.entities.ActionConfig; 5 import org.apache.commons.logging.Log; 6 import org.apache.commons.logging.LogFactory; 7 8 import java.util.Set ; 9 import java.util.TreeSet ; 10 11 16 public class ActionNamesAction extends ActionSupport { 17 private Set actionNames; 18 private String namespace = ""; 19 private Set namespaces; 20 private static Log log = LogFactory.getLog(ActionNamesAction.class); 21 22 public Set getActionNames() { 23 return actionNames; 24 } 25 26 public String getNamespace() { 27 return namespace; 28 } 29 30 public void setNamespace(String namespace) { 31 this.namespace = namespace; 32 } 33 34 public ActionConfig getConfig(String actionName) { 35 return ConfigurationHelper.getActionConfig(namespace, actionName); 36 } 37 38 public Set getNamespaces() { 39 return namespaces; 40 } 41 42 public String execute() throws Exception { 43 namespaces = ConfigurationHelper.getNamespaces(); 44 if (namespaces.size() == 0) { 45 addActionError("There are no namespaces in this configuration"); 46 return ERROR; 47 } 48 if (namespace == null) { 49 namespace = ""; 50 } 51 actionNames = 52 new TreeSet (ConfigurationHelper.getActionNames(namespace)); 53 return SUCCESS; 54 } 55 } 56 | Popular Tags |