1 23 package org.infoglue.cms.applications.workflowtool.function.email; 24 25 import java.util.Collection ; 26 import java.util.Iterator ; 27 28 import org.apache.log4j.Logger; 29 import org.infoglue.cms.security.InfoGluePrincipal; 30 31 import com.opensymphony.workflow.WorkflowException; 32 33 36 public abstract class UsersAddressProvider extends AddressProvider 37 { 38 private final static Logger logger = Logger.getLogger(UsersAddressProvider.class.getName()); 39 40 43 public UsersAddressProvider() 44 { 45 super(); 46 } 47 48 53 protected abstract Collection getPrincipals() throws WorkflowException; 54 55 59 protected void populate() throws WorkflowException 60 { 61 for(final Iterator principals = getPrincipals().iterator(); principals.hasNext(); ) 62 { 63 final InfoGluePrincipal principal = (InfoGluePrincipal) principals.next(); 64 logger.debug("Creating email for user [" + principal.getName() + "]."); 65 addRecipient(principal.getEmail()); 66 } 67 } 68 } | Popular Tags |