View Javadoc
1   package org.argeo.cms.e4.users;
2   
3   import javax.transaction.UserTransaction;
4   
5   /** First effort to centralize back end methods used by the user admin UI */
6   public class UiAdminUtils {
7   	/*
8   	 * INTERNAL METHODS: Below methods are meant to stay here and are not part
9   	 * of a potential generic backend to manage the useradmin
10  	 */
11  	/** Easily notify the ActiveWindow that the transaction had a state change */
12  	public final static void notifyTransactionStateChange(
13  			UserTransaction userTransaction) {
14  //		try {
15  //			IWorkbenchWindow aww = PlatformUI.getWorkbench()
16  //					.getActiveWorkbenchWindow();
17  //			ISourceProviderService sourceProviderService = (ISourceProviderService) aww
18  //					.getService(ISourceProviderService.class);
19  //			UserTransactionProvider esp = (UserTransactionProvider) sourceProviderService
20  //					.getSourceProvider(UserTransactionProvider.TRANSACTION_STATE);
21  //			esp.fireTransactionStateChange();
22  //		} catch (Exception e) {
23  //			throw new CmsException("Unable to begin transaction", e);
24  //		}
25  	}
26  
27  	/**
28  	 * Email addresses must match this regexp pattern ({@value #EMAIL_PATTERN}.
29  	 * Thanks to <a href=
30  	 * "http://www.mkyong.com/regular-expressions/how-to-validate-email-address-with-regular-expression/"
31  	 * >this tip</a>.
32  	 */
33  	public final static String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
34  }