[jboss-svn-commits] JBL Code SVN: r33545 - in labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main: plugin and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Jun 18 08:53:40 EDT 2010
Author: lkrzyzanek
Date: 2010-06-18 08:53:40 -0400 (Fri, 18 Jun 2010)
New Revision: 33545
Added:
labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/java/org/jboss/labs/sbs/plugin/nukesauth/struts/EditJBossProfile.java
Modified:
labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/plugin/struts.xml
Log:
Added action for editing profile with validation on e-mail (against Nukes DB)
Added: labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/java/org/jboss/labs/sbs/plugin/nukesauth/struts/EditJBossProfile.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/java/org/jboss/labs/sbs/plugin/nukesauth/struts/EditJBossProfile.java (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/java/org/jboss/labs/sbs/plugin/nukesauth/struts/EditJBossProfile.java 2010-06-18 12:53:40 UTC (rev 33545)
@@ -0,0 +1,53 @@
+/*
+ * JBoss Community http://jboss.org/
+ *
+ * Copyright (c) 2010 Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Libor Krzyzanek
+ */
+package org.jboss.labs.sbs.plugin.nukesauth.struts;
+
+import java.util.List;
+
+import org.jboss.labs.sbs.plugin.nukesauth.NukesAccountManager;
+import org.jboss.labs.sbs.plugin.nukesauth.dao.NukesUser;
+
+import com.jivesoftware.community.action.EditProfile;
+
+/**
+ * Action extends {@link EditProfile} action and provides validation on e-mail.
+ *
+ * @author <a href="mailto:lkrzyzan at redhat.com">Libor Krzyzanek</a>
+ */
+public class EditJBossProfile extends EditProfile {
+
+ private NukesAccountManager nukesAccountManager;
+
+ @Override
+ public void validate() {
+ List<NukesUser> nukesUser = nukesAccountManager.getNukesAccountsByEmail(getEmail());
+ if (!nukesUser.isEmpty()) {
+ addFieldError("email", getText("account.err.email_taken.text"));
+ }
+ super.validate();
+ }
+
+ public void setNukesAccountManager(NukesAccountManager nukesAccountManager) {
+ this.nukesAccountManager = nukesAccountManager;
+ }
+
+}
Property changes on: labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/java/org/jboss/labs/sbs/plugin/nukesauth/struts/EditJBossProfile.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/plugin/struts.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/plugin/struts.xml 2010-06-18 12:10:11 UTC (rev 33544)
+++ labs/jbosslabs/labs-3.0-build/integration/sbs-nukesauthentication/trunk/src/main/plugin/struts.xml 2010-06-18 12:53:40 UTC (rev 33545)
@@ -44,7 +44,7 @@
class="org.jboss.labs.sbs.plugin.nukesauth.struts.UpdateMasterAccountAction"
method="accountUpdated">
<result name="accountUpdated" type="freemarker">
- /plugins/nukesauthentication/resources/templates/update-master-account-success.ftl
+ /plugins/nukesauthentication/resources/templates/update-master-account-success.ftl
</result>
<interceptor-ref name="paramsPrepareParamsStack" />
</action>
@@ -74,6 +74,17 @@
<result name="success">/template/global/reset-password.ftl</result>
</action>
+ <action name="edit-jboss-profile" class="org.jboss.labs.sbs.plugin.nukesauth.struts.EditJBossProfile">
+ <interceptor-ref name="paramsPrepareParamsStack" />
+ <interceptor-ref name="token">
+ <param name="excludeMethods">input,cancel</param>
+ </interceptor-ref>
+ <result name="cancel" type="redirect">${redirect}</result>
+ <result name="input">/template/global/edit-profile.ftl</result>
+ <result name="success" type="redirect">${redirect}</result>
+ </action>
+
+
</package>
</struts>
More information about the jboss-svn-commits
mailing list