1 23 package org.infoglue.cms.applications.workflowtool.function; 24 25 import java.util.Iterator ; 26 27 import com.opensymphony.workflow.WorkflowException; 28 29 32 public class PropertysetPopulator extends InfoglueFunction 33 { 34 37 private static final String PREFIX_ARGUMENT = "prefix"; 38 39 42 private String prefix; 43 44 45 46 49 public PropertysetPopulator() 50 { 51 super(); 52 } 53 54 57 protected void execute() throws WorkflowException { 58 cleanPropertySet(); 59 populate(); 60 } 61 62 65 private void populate() throws WorkflowException 66 { 67 for(final Iterator i = getParameters().keySet().iterator(); i.hasNext(); ) 68 { 69 String key = i.next().toString(); 70 if(key.startsWith(prefix)) 71 { 72 setPropertySetDataString(key, getRequestParameter(key)); 73 } 74 } 75 } 76 77 83 protected void initialize() throws WorkflowException 84 { 85 super.initialize(); 86 prefix = getArgument(PREFIX_ARGUMENT); 87 } 88 89 92 private void cleanPropertySet() throws WorkflowException 93 { 94 removeFromPropertySet(prefix, true); 95 } 96 } 97 | Popular Tags |