package com.unicacorp.uap.common.template; import java.util.HashMap; /** This is an interface to be implemented by the end user of a Marketing Operations system for the purpose of validating system generated id values as per business logic. Implementations of this Interface are called by the Marketing Operations Server. */ public interface IdValidate { /** Returns true if the specified attribute values are valid. * * @param id - current project or program id. This will be the value if it is new project/program * @param values - This is a set of name/value pairs, referring to a current database connection, the appropriate template id and another HashMap that contains name/value pairs, corresponding to the fields and values on the screen. * @return true - if it is valid; otherwise returns false or throws exception. * @throws com.unicacorp.uap.user.IdValidateException * Should contain a message value that is meaningful about what went wrong. */
public boolean isValid(int id, HashMap values) throws IdValidateException; /** The name of the hashkey in the HashMap passed to IdValidate.isValid(..) that refers to a current database connection to the Marketing Operations system tables. This connection is available for use to implementations of this interface. */ public final String PLAN_DB_CONNECTION = "dbconnection"; /** * The name of the hashkey in the HashMap passed to idValidate.isValid(..) that refers to the id of the related template. */ public final String OBJECT_TEMPLATE_ID = "templateid"; /** * The name of the hashkey in the HashMap pass to * IdValidate.isValid(..) that refers to another Hashmap which * contains name/value pairs. The name corresponds to a field on * the screen for project/program and the value corresponds to the * user entered text or selection. */ public final String OBJECT_ATTRIB_VALUES = "attributeValues"; }
package com.unicaorp.uap.common.template; import java.util.HashMap; /* This is an interface to be implemented by the end user * of a Marketing Operations * system for the purpose of generating unique Project Code (PIDs). The intent * is to allow users to attach to existing enterprise systems to help make * project IDs meaningful in their enterprise. * * Implementations of this Interface are called by the Marketing Operations Server. * It is the responsibility of the Marketing Operations Server * to assure that there is * only one ID being generated at a time. When implementation of this * interface are called, they can assume that there are no other IDs * that are being generated concurrently. */
public interface IdGenerate { /** * Returns a string code used to define a Project object with Marketing Operations * * @param uniqueId - This is an integer value that is generated by * the Marketing Operations system. This is guaranteed to be unique across * the system; hence, if the project ID returned is the string * representation of this integer, it will be a unique * Project Code (PID). * * @param values - This is a set of name/value pairs, referring to the current * database connection, appropriate template id, code prefix, * request flag, and another HashMap that contains name/value * pairs, corresponding to the fields and values on the screen. * * @param uniqueChecker - An implementation used to verify the uniqueness of * of ID's generated by this instance. * * @return - A string that represents the ID of the project we are creating. * * @throws com.unicacorp.uap.user.IdGenerateException * Should contain a message value that is meaningful about * what went wrong */