Commits

Juan Carlos Picado Herrera committed dcca5a6

Fixed hql issue

  • Participants
  • Parent commits 6082ca8

Comments (0)

Files changed (4)

encuestame-business/src/main/java/org/encuestame/business/security/EnMeAuthenticationProvider.java

+/*
+ ************************************************************************************
+ * Copyright (C) 2001-2011 encuestame: system online surveys Copyright (C) 2009
+ * encuestame Development Team.
+ * Licensed under the Apache Software License version 2.0
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to  in writing,  software  distributed
+ * under the License is distributed  on  an  "AS IS"  BASIS,  WITHOUT  WARRANTIES  OR
+ * CONDITIONS OF ANY KIND, either  express  or  implied.  See  the  License  for  the
+ * specific language governing permissions and limitations under the License.
+ ************************************************************************************
+ */
+package org.encuestame.business.security;
+
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+
+/**
+ * Custom Authentication Provider.
+ * @author Picado, Juan juanATencuestame.org
+ * @since Jan 23, 2011 2:29:04 PM
+ * @version $Id:$
+ */
+public class EnMeAuthenticationProvider implements AuthenticationProvider {
+
+    /* (non-Javadoc)
+     * @see org.springframework.security.authentication.AuthenticationProvider#authenticate(org.springframework.security.core.Authentication)
+     */
+    public Authentication authenticate(Authentication authentication)
+            throws AuthenticationException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.springframework.security.authentication.AuthenticationProvider#supports(java.lang.Class)
+     */
+    public boolean supports(Class<? extends Object> authentication) {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+}

encuestame-persistence/src/main/java/org/encuestame/persistence/dao/imp/NotificationDao.java

      * @return
      */
     @SuppressWarnings("unchecked")
-    private Long retrieveCountNotification(final Account secUser, final String query){
+    private Long retrieveCountNotification(final Account account, final String query){
         Long resultsSize = 0L;
-        final List<Object> list =  getHibernateTemplate().findByNamedParam(query, "user", secUser);
+        final List<Object> list =  getHibernateTemplate().findByNamedParam("select count(*) from Notification "
+                +" WHERE account =:user AND readed = false", "user", account);
         if (list.get(0) instanceof Long){
             resultsSize = (Long) list.get(0);
         }
      * @param secUser
      * @return
      */
-    @SuppressWarnings("unchecked")
     public Long retrieveTotalNotReadedNotificationStatus(final Account user){
         return retrieveCountNotification(user ,"select count(*) from Notification "
-                +" WHERE account = :user AND readed = false");
+                +" WHERE account =:account AND readed = false");
     }
 
     /**

encuestame-war/src/main/webapp/WEB-INF/flows/signup/error.jsp

+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<%@ include file="/WEB-INF/jsp/includes/initPage.jsp" %>
+<%@ include file="/WEB-INF/jsp/includes/publicBody.jsp" %>
+    <div id="mainUserWrapper">
+        <!--
+            //FUTURE: get Friends
+            http://code.google.com/apis/contacts/docs/3.0/developers_guide_java.html#Retrieving
+         -->
+         <form:form>
+            <h2>
+                Error
+            </h2>
+        </form:form>
+    </div>
+<%@ include file="/WEB-INF/jsp/includes/footer.jsp" %>

encuestame-war/src/main/webapp/WEB-INF/flows/signup/noAccess.jsp

+<%@ include file="/WEB-INF/jsp/includes/taglibs.jsp" %>
+<%@ include file="/WEB-INF/jsp/includes/initPage.jsp" %>
+<%@ include file="/WEB-INF/jsp/includes/publicBody.jsp" %>
+    <div id="mainUserWrapper">
+        <!--
+            //FUTURE: get Friends
+            http://code.google.com/apis/contacts/docs/3.0/developers_guide_java.html#Retrieving
+         -->
+         <form:form>
+            <h2>
+                No Access
+            </h2>
+        </form:form>
+    </div>
+<%@ include file="/WEB-INF/jsp/includes/footer.jsp" %>