Juan Carlos Picado Herrera avatar Juan Carlos Picado Herrera committed db7d2a0 Merge

Merge branch 'development' into dianmorales

Comments (0)

Files changed (35)

encuestame-business/src/main/java/org/encuestame/business/search/ReIndexAttachmentsJob.java

     private List<File> getListOfAccountEnabledDirectories(){
         final List<File> userDomainAttachmentsLocation = new ArrayList<File>();
         final List<Long> listOfAccounts = getAccountDao().getAccountsEnabled();
-        log.debug("listOfAccounts enabled"+listOfAccounts.size());
+        log.debug("listOfAccounts enabled:{"+listOfAccounts.size());
         for (Long accountId : listOfAccounts) {
             final StringBuilder path = new StringBuilder(DirectorySetupOperations.getProfilesDirectory());
             path.append("/");

encuestame-business/src/main/java/org/encuestame/business/service/AbstractIndexService.java

     private Log log = LogFactory.getLog(this.getClass());
 
     /** Search Manager Operation**/
-    @Autowired
-    private SearchManagerOperation searchOperation;
+    @Autowired(required = false)
+    private SearchManagerOperation searchOperation; //TODO:ENCUESTAME-154
 
     /**
      * List Suggested Hash Tags.
         return questions;
     }
 
-
-    public List<AttachmentSearchItem> getAttachmentItem(final String keyword, final int maxResults, final String field) throws IOException, ParseException{
-        final List<Document> attachItems = getSearchOperation().search(keyword, maxResults, field);
+    /**
+     *
+     * @param keyword
+     * @param maxResults
+     * @param field
+     * @return
+     * @throws IOException
+     * @throws ParseException
+     */
+    public List<AttachmentSearchItem> getAttachmentItem(final String keyword,
+            final int maxResults, final String field) throws IOException,
+            ParseException {
+        final List<Document> attachItems = getSearchOperation().search(keyword,
+                maxResults, field);
         return this.convertDocumentToListAttachment(attachItems);
     }
 
     /**
     * @param searchOperation the searchOperation to set
     */
-    public void setSearchOperation(SearchManagerOperation searchOperation) {
+    public void setSearchOperation(final SearchManagerOperation searchOperation) {
         this.searchOperation = searchOperation;
     }
 

encuestame-business/src/main/resources/org/encuestame/business/config/encuestame-config.properties

 #--------------------------------------------------------------------------------
 # Required app config.
 #--------------------------------------------------------------------------------
+
 application.name = encuestame
-application.context = true
-application.urlImg = /images
+# default app title
+application.title = encuestame survey system
+#
 application.encoding = UTF-8
+
 application.apiKeygoogle = ${google.maps.key}
+
 application.domain = http://localhost:8080/
 
+application.logo.small = images/logos/encuestame_header_grey.jpg
+application.logo.medium = images/logos/encuestame_header_grey.jpg
+application.logo.huge = images/logos/encuestame_header_grey.jpg
+
+# enabled singup for anonymous users
+application.signup.enabled = true
+# define if anonymous users are allowed, only logged user.
+application.private = true
+# mobile view is enabled or disabled
+application.mobile.enabled = true
+# define if the only mobile view should be displayed
+application.mobile.only = false
+# define if user can log in with social accounts
+application.social.signin.enabled = false
+
 #--------------------------------------------------------------------------------
 # Proxy configuration
 #--------------------------------------------------------------------------------

encuestame-business/src/main/resources/spring-test/encuestame-service-context.xml

 
   <bean id="pictureService" class="org.encuestame.business.service.PictureService" parent="service"/>
 
-  <!-- Seach Service  -->
+    <!-- Seach Service  -->
   <bean id="abstractIndexService" class="org.encuestame.business.service.AbstractIndexService" abstract="true"
       parent="service"/>
 
     </bean>
     -->
 
+    <!-- Startup Support -->
+    <bean id="install" class="org.encuestame.business.setup.install.DatabaseInstall" scope="singleton"/>
+    <bean id="applicationStartup" class="org.encuestame.business.setup.ApplicationStartup" scope="singleton"/>
 
 </beans>

encuestame-mvc/src/main/java/org/encuestame/mvc/controller/security/SignUpAccountFormController.java

 import net.tanesha.recaptcha.ReCaptchaResponse;
 
 import org.apache.log4j.Logger;
+import org.encuestame.business.config.EncuestamePlaceHolderConfigurer;
 import org.encuestame.core.security.util.PasswordGenerator;
 import org.encuestame.mvc.validator.ValidateOperations;
 import org.encuestame.utils.security.SignUpBean;
     @RequestMapping(method = RequestMethod.GET)
     public String addHandler(Model model) {
         log.info("/register");
-        final SignUpBean user = new SignUpBean();
-        final String captcha = getReCaptcha().createRecaptchaHtml(null, null);
-        user.setCaptcha(captcha);
-        log.info("username "+user.getCaptcha());
-        model.addAttribute(user);
-        return "user/signup";
+        final Boolean privateHome = EncuestamePlaceHolderConfigurer
+        .getBooleanProperty("application.signup.enabled");
+        if (privateHome) {
+            log.debug("signup is disabled");
+            return "redirect:/signin.jspx";
+        } else {
+            final SignUpBean user = new SignUpBean();
+            final String captcha = getReCaptcha().createRecaptchaHtml(null, null);
+            user.setCaptcha(captcha);
+            log.info("username "+user.getCaptcha());
+            model.addAttribute(user);
+            return "user/signup";
+        }
     }
 
     /**

encuestame-mvc/src/main/java/org/encuestame/mvc/interceptor/DefaultEnMeInterceptor.java

 
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.log4j.Logger;
+import org.encuestame.business.config.EncuestamePlaceHolderConfigurer;
 import org.encuestame.core.security.SecurityUtils;
 import org.joda.time.DateTimeZone;
 import org.springframework.security.core.Authentication;
  * Default Interceptor for all Controllers.
  * @author Picado, Juan juanATencuestame.org
  * @since Dec 26, 2010 3:34:59 PM
- * @version $Id:$
  */
 public class DefaultEnMeInterceptor implements HandlerInterceptor {
 
 
     private final String COOKIE_CONTEXT = "en_me-context";
 
+    /**
+     * Default logo path.
+     */
+    private final String DEFAULT_LOGO = "/images/logos/logo.jpg";
+
+    /**
+     * Return customized logo path or default is customized is not defined.
+     */
+    private String getCustomizedHeaderLogo(){
+        String customizedLogo = EncuestamePlaceHolderConfigurer.getProperty("application.logo.small");
+        if (customizedLogo == null) {
+            customizedLogo = this.DEFAULT_LOGO;
+        }
+        log.debug("customized logo:{"+customizedLogo);
+        return customizedLogo;
+    }
+
     /* (non-Javadoc)
      * @see org.springframework.web.servlet.HandlerInterceptor#preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object)
      */
             log.info("Session Expired");
             request.setAttribute("logged", false);
         }
+        //customized logo
+        request.setAttribute("logo", this.getCustomizedHeaderLogo());
         return true;
     }
 

encuestame-mvc/src/main/java/org/encuestame/mvc/interceptor/EnMeMobileInterceptor.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.mvc.interceptor;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.encuestame.business.config.EncuestamePlaceHolderConfigurer;
+import org.springframework.mobile.device.Device;
+import org.springframework.mobile.device.DeviceResolver;
+import org.springframework.mobile.device.DeviceUtils;
+import org.springframework.mobile.device.LiteDeviceResolver;
+import org.springframework.web.servlet.HandlerInterceptor;
+import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
+
+/**
+ * Extended Interceptor for mobile device.
+ * @author Picado, Juan juanATencuestame.org
+ * @since Mar 30, 2011
+ */
+public class EnMeMobileInterceptor extends HandlerInterceptorAdapter {
+
+    /**
+     * Device resolver.
+     */
+    private final DeviceResolver deviceResolver;
+
+    /**
+     * Log.
+     */
+    private static Logger log = Logger.getLogger(EnMeMobileInterceptor.class);
+
+    /**
+     * Create a device resolving {@link HandlerInterceptor} that defaults to a {@link LiteDeviceResolver} implementation.
+     */
+    public EnMeMobileInterceptor() {
+        this(new LiteDeviceResolver());
+        log.debug("Creating EnMeMobileInterceptor");
+    }
+
+    /**
+     * Create a device resolving {@link HandlerInterceptor}.
+     * @param deviceResolver the device resolver to delegate to in
+     * {@link #preHandle(HttpServletRequest, HttpServletResponse, Object)}
+     */
+    public EnMeMobileInterceptor(DeviceResolver deviceResolver) {
+        log.debug("Creating EnMeMobileInterceptor deviceResolver:{"+deviceResolver);
+        this.deviceResolver = deviceResolver;
+    }
+
+    /**
+     * Override device selected operation.
+     */
+    @Override
+    public boolean preHandle(javax.servlet.http.HttpServletRequest request,
+            HttpServletResponse response, Object handler) throws Exception {
+        Device device = deviceResolver.resolveDevice(request);
+        log.debug("customized mobile resolver");
+        final Boolean enabledMobileDevice = EncuestamePlaceHolderConfigurer
+                .getBooleanProperty("application.mobile.enabled");
+        log.debug("deviceResolver application.mobile.enabled:{"+enabledMobileDevice);
+        final Boolean forceMobileDevice = EncuestamePlaceHolderConfigurer
+                .getBooleanProperty("application.mobile.only");
+        log.debug("deviceResolver application.mobile.only:{"+forceMobileDevice);
+        // is mobile device enabled?
+        if (enabledMobileDevice) {
+            //force to use mobile view.
+            if (forceMobileDevice) {
+                request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE,
+                        new EnMeDevice(Boolean.TRUE));
+            } else {
+                request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE,
+                        device);
+            }
+        } else {
+            request.setAttribute(DeviceUtils.CURRENT_DEVICE_ATTRIBUTE, new EnMeDevice(Boolean.FALSE));
+        }
+        return true;
+    }
+}
+
+/**
+ * Customized device implementation.
+ */
+class EnMeDevice implements Device {
+
+    private boolean device = false;
+
+    public EnMeDevice(final boolean device) {
+        this.device = device;
+    }
+
+    @Override
+    public boolean isMobile() {
+        return device;
+    }
+}

encuestame-mvc/src/main/java/org/encuestame/mvc/view/HomeController.java

 
 package org.encuestame.mvc.view;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.encuestame.business.config.EncuestamePlaceHolderConfigurer;
 import org.encuestame.mvc.controller.BaseController;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
      * @return template
      */
     @RequestMapping(value = "/home.jspx", method = RequestMethod.GET)
-    public String homeController(ModelMap model) {
+    public String homeController(
+            ModelMap model,
+            HttpServletRequest request,
+            HttpServletResponse response) {
+        final Boolean privateHome = EncuestamePlaceHolderConfigurer.getBooleanProperty("application.private");
         log.debug("HOME");
-        return "home";
+        if (privateHome) {
+            log.debug("signup is disabled");
+            return "redirect:/signin.jspx";
+        } else {
+            return "home";
+        }
     }
 }

encuestame-mvc/src/main/java/org/encuestame/mvc/view/LoginController.java

 
 package org.encuestame.mvc.view;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 import org.apache.log4j.Logger;
+import org.encuestame.business.config.EncuestamePlaceHolderConfigurer;
 import org.encuestame.mvc.controller.BaseController;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
      * @return template
      */
     @RequestMapping(value = "/signin.jspx", method = RequestMethod.GET)
-    public String signInController(final ModelMap model) {
+    public String signInController(
+            final ModelMap model,
+            HttpServletResponse response,
+            HttpServletRequest request) {
+        final Boolean enabledSocialSignIn = EncuestamePlaceHolderConfigurer
+                     .getBooleanProperty("application.social.signin.enabled");
+        request.setAttribute("social", enabledSocialSignIn);
         log.debug("login");
         return "signin";
     }

encuestame-mvc/src/main/resources/spring-test/encuestame-controller-context.xml

      <property name="order" value="0"/>
   </bean>
 
-  <bean id="mobileInterceptor" class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor" />
+  <bean id="mobileInterceptor" class="org.encuestame.mvc.interceptor.EnMeMobileInterceptor" />
   <bean id="enMeInterceptor" class=" org.encuestame.mvc.interceptor.DefaultEnMeInterceptor" />
   <bean name="openSessionInViewInterceptor"
             class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">

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

 /*
  ************************************************************************************
- * Copyright (C) 2001-2009 encuestame: system online surveys Copyright (C) 2009
+ * 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

encuestame-persistence/src/main/resources/properties-test/encuestame-test-config.properties

 #Application Config.
 #----------------------------------
 application.name = encuestame
-application.context = true
-application.urlImg = /images
 application.encoding = UTF-8
 application.apiKeygoogle = ${google.maps.key}
 application.domain = http://localhost:8080/

encuestame-persistence/src/main/resources/properties-test/log4j-test.properties

 # log4j.properties for
 
 # Set root category priority to ERROR and its only appender to LOGFILE.
-log4j.rootCategory=WARN, LOGFILE
+log4j.rootCategory=DEBUG, LOGFILE
 
 #Spring Framework
 log4j.logger.org.springframework.security.oauth=WARN

encuestame-war/pom.xml

                           <pathelement location="../dojo/util/shrinksafe/shrinksafe.jar"/>
                         </classpath>
                         <property file="${basedir}/dojo.properties"/>
-                        <!--  To optimize JS uncomment this.
+                        <!--  To optimize JS uncomment this.-->
                         <target unless="build">
                             <java
                              fork="true"
                            </delete>
                           <echo message="Dojo optimized." />
                         </target>
-                        -->
                     </configuration>
                     <goals>
                         <goal>run</goal>
             </executions>
         </plugin>
         <!--
-        Customize and Optimize WAR file.
+        Customize and Optimize WAR file.-->
         <plugin>
             <artifactId>maven-war-plugin</artifactId>
             <version>2.1.1</version>
                     resource/js/dojo/**/*,
                     resource/js/dijit/**/*,
                     resource/js/dojox/**/*,
+                    resource/js/cometd.js,
+                    resource/js/chart.js,
+                    resource/js/org/**/*,
                     **/*.properties,
                     **/*.class,
                     **/*.ico,
                     </resource>
                 </webResources>
             </configuration>
-            </plugin> -->
-
-        <!-- Development War Configuration - NOT Optimized -->
+            </plugin>
+        <!-- Development War Configuration - NOT Optimized
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-war-plugin</artifactId>
                     </manifestEntries>
                 </archive>
             </configuration>
-        </plugin>
+        </plugin> -->
         <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
             <groupId>commons-dbcp</groupId>
             <artifactId>commons-dbcp</artifactId>
         </dependency>
-        <dependency> 
+        <dependency>
             <groupId>org.apache.lucene</groupId>
             <artifactId>lucene-snowball</artifactId>
-        </dependency>                                          
+        </dependency>
     </dependencies>
 
     <repositories>

encuestame-war/src/main/webapp/WEB-INF/jsp/includes/javascript.jsp

 <script src="<%=request.getContextPath()%>/resource/js/dojo/dojo.js"
-        djConfig="parseOnLoad: true, useCommentedJson:true, isDebug: true"></script>
-        <script src="<%=request.getContextPath()%>/resource/js/dojo/encuestame-widgets.js"
-        djConfig="parseOnLoad: true, useCommentedJson:true, isDebug: true"></script>
+        djConfig="parseOnLoad: true, useCommentedJson:true, isDebug: false"></script>
+<script src="<%=request.getContextPath()%>/resource/js/dojo/encuestame-commons.js"></script>
 <style type="text/css">
       @import "<%=request.getContextPath()%>/resource/js/dijit/themes/claro/claro.css";
       @import "<%=request.getContextPath()%>/resource/js/dojox/form/resources/Rating.css";

encuestame-war/src/main/webapp/WEB-INF/layouts/standard/header.jsp

 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
 <div id="publicLineHeader">
-        <div class="headerOptions">
-                <form method="get" action="<%=request.getContextPath()%>/search.jspx">
-                        <span class="link">
-                            <c:if test="${!logged}">
-                                <a href="<%=request.getContextPath()%>/signin.jspx">Sign In</a>
-                           </c:if>
-                        </span>
-                         <span class="link">
-                            <c:if test="${logged}">
-                                <div dojoType="encuestame.org.core.commons.dashboard.DashBoardMenu"
-                                    contextPath="<%=request.getContextPath()%>"></div>
-                            </c:if>
-                         </span>
-                        <span class="link">
-                         <span id="navbar">
-                            <c:if test="${logged}">
-                                <%@ include file="/WEB-INF/jsp/includes/profile.jsp" %>
-                            </c:if>
-                         </span>
-                        </span>
-                    <span class="search">
-                        <div dojoType="encuestame.org.core.commons.search.SearchMenu"></div>
-                    </span>
-                </form>
-        </div>
-        <div style="float: left;">
-            <a href="<%=request.getContextPath()%>/home">
-                <span class="logoSmallEncuestame"></span>
+        <div class="logo">
+            <a href="<%=request.getContextPath()%>">
+                <img alt="logo" src="<%=request.getContextPath()%>/resource/${logo}">
             </a>
         </div>
+        <div class="headerOptions">
+            <c:if test="${!logged}">
+               <span class="link">
+                   <a href="<%=request.getContextPath()%>/signin.jspx">Sign In</a>
+               </span>
+             </c:if>
+             <c:if test="${logged}">
+                <span class="link">
+                    <div dojoType="encuestame.org.core.commons.dashboard.DashBoardMenu"
+                         contextPath="<%=request.getContextPath()%>"></div>
+                </span>
+             </c:if>
+             <c:if test="${logged}">
+                  <span class="link">
+                     <span id="navbar">
+                           <%@ include file="/WEB-INF/jsp/includes/profile.jsp" %>
+                     </span>
+                 </span>
+             </c:if>
+             <form method="get" action="<%=request.getContextPath()%>/search.jspx" style="float: right;margin: 4px 4px 3px 0;">
+                     <div dojoType="encuestame.org.core.commons.search.SearchMenu"></div>
+             </form>
+        </div>
 </div>

encuestame-war/src/main/webapp/WEB-INF/layouts/standard/page.jsp

     <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
     <meta name="description" content="encuestame survey system" />
     <meta name="keywords" content="survey, twitter, social, open source, etc, etc" />
+    <script type="text/javascript">
+        var config = {
+            contextPath: '<%=request.getContextPath()%>'
+        };
+        var cometd = dojox.cometd;
+
+        var contextPathRoot = '<%=request.getContextPath()%>';
+    </script>
     <%@ include file="/WEB-INF/jsp/includes/web/css.jsp" %>
     <%@ include file="/WEB-INF/jsp/includes/javascript.jsp" %>
     <script type="text/javascript">
          dojo.require("dijit.dijit");
          dojo.require("dojo.parser");
-         dojo.require("encuestame.org.core.contextWidget");
-         dojo.require("encuestame.org.core.commons.notifications.Notification");
-         dojo.require("encuestame.org.core.commons.profile.ProfileMenu");
          dojo.require("encuestame.org.core.commons.search.SearchMenu");
          dojo.require("encuestame.org.core.commons.dashboard.DashBoardMenu");
          dojo.require("encuestame.org.core.commons.error.ErrorSessionHandler");
          dojo.require("dojo.io.script");
          dojo.require("dojox.cometd");
          //dojo.require("dojox.cometd.callbackPollTransport");
-    </script>
-<script type="text/javascript">
-    var config = {
-        contextPath: '<%=request.getContextPath()%>'
-    };
-    var cometd = dojox.cometd;
 </script>
+<c:if test="${logged}">
+  <script type="text/javascript">
+             dojo.require("encuestame.org.core.commons.notifications.Notification");
+             dojo.require("encuestame.org.core.commons.profile.ProfileMenu");
+  </script>
+</c:if>
 <script src="<%=request.getContextPath()%>/resource/js/cometd.js"></script>
 </head>
 <body class="claro">
-<div id="contextWidget" dojoType="encuestame.org.core.contextWidget" contextPath="<%=request.getContextPath()%>"></div>
-    <div id="header">
-        <tiles:insertAttribute name="header" />
-    </div>
      <div id="mainWrapper">
+        <div id="header">
+            <tiles:insertAttribute name="header" />
+        </div>
         <tiles:insertAttribute name="menu" ignore="true" />
         <div id="content-container">
             <div id="content">
         </div>
      </div>
 </body>
-</html>
+</html>

encuestame-war/src/main/webapp/WEB-INF/spring/encuestame-controller-context.xml

                <ref bean="enMeInterceptor"/>
                <ref bean="openSessionInViewInterceptor"/>
                <ref bean="setupInterceptor"/>
+               <ref bean="mobileInterceptor"/>
           </list>
       </property>
      <property name="order" value="0"/>
   </bean>
 
-  <bean id="mobileInterceptor" class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor" />
+  <bean id="mobileInterceptor" class="org.encuestame.mvc.interceptor.EnMeMobileInterceptor" />
   <bean id="enMeInterceptor" class=" org.encuestame.mvc.interceptor.DefaultEnMeInterceptor" />
   <bean id="setupInterceptor" class=" org.encuestame.mvc.interceptor.SetupInterceptor" />
   <bean name="openSessionInViewInterceptor"

encuestame-war/src/main/webapp/WEB-INF/spring/encuestame-quartz-context.xml

                  <!--  Reindex domains -->
                  <bean id="cronReindex" class="org.springframework.scheduling.quartz.CronTriggerBean">
                     <property name="jobDetail" ref="reindexingInvokingJobDetail" />
-                    <property name="cronExpression" value="0 0/3 * * * ?" />
+                    <property name="cronExpression" value="0 0/5 * * * ?" />
                     <!-- Every 5 minutes 0 0/5 * * * ? -->
+                    <!-- 0 0 12 * * ?   Fire at 12pm (noon) every day -->
                     <!-- 0 0 12 1/5 * ? Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. -->
                 </bean>
                 <!-- Reindex attachments -->
                 <bean id="attachmentsReindex" class="org.springframework.scheduling.quartz.CronTriggerBean">
                     <property name="jobDetail" ref="reindexingAttachmentsJobDetail" />
-                    <property name="cronExpression" value="0 0/4 * * * ?" />
+                    <property name="cronExpression" value="0 15 10 * * ? *" />
                     <!-- Every 5 minutes 0 0/5 * * * ? -->
+                    <!-- Fire at 10:15am every day 0 15 10 * * ? * -->
                     <!-- 0 0 12 1/5 * ? Fire at 12pm (noon) every 5 days every month, starting on the first day of the month. -->
                 </bean>
             </list>

encuestame-war/src/main/webapp/WEB-INF/spring/encuestame-task.xml

         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
     <!-- Enables annotation-driven asynchronous tasks e.g. @Async -->
-    <annotation-driven mode="aspectj" executor="taskExecutor" />
+    <task:annotation-driven executor="taskExecutor" />
+    <!--   mode="aspectj" problem on deploy on tomcat. ENCUESTAME-130 -->
 
     <!-- Worker thread pool -->
-    <executor id="taskExecutor" />
+    <task:executor id="taskExecutor" />
+
 
     <beans:import resource="encuestame-quartz-context.xml"/>
     <beans:import resource="encuestame-task-search.xml"/>

encuestame-war/src/main/webapp/WEB-INF/views/user/web/signin.jsp

             </form>
       </div>
     </div>
-    <div class="socialConnect">
-        <div class="title">Do you already have an account on one of these sites?</div>
-        <div class="twitter">
-            <form action="<%=request.getContextPath()%>/signin/twitter.jspx" method="POST">
-                <button type="submit">
-                    <img src="<c:url value="/resource/images/social/twitter/signin.png" />"
-                </button>
-            </form>
-        </div>
-        <div class="facebook">
-                <script>
-                    function signInWithFacebook() {
-                        FB.getLoginStatus(function(response) {
-                            if (response.session) {
-                                dojo.byId('fb_signin').submit();
-                            }
+     <c:if test="${social}">
+      <div class="socialConnect">
+          <div class="title">Do you already have an account on one of these sites?</div>
+          <div class="twitter">
+              <form action="<%=request.getContextPath()%>/signin/twitter.jspx" method="POST">
+                  <button type="submit">
+                      <img src="<c:url value="/resource/images/social/twitter/signin.png" />"
+                  </button>
+              </form>
+          </div>
+          <div class="facebook">
+                  <script>
+                      function signInWithFacebook() {
+                          FB.getLoginStatus(function(response) {
+                              if (response.session) {
+                                  dojo.byId('fb_signin').submit();
+                              }
+                            });
+                      }
+                  </script>
+                  <div id="fb-root"></div>
+                  <form id="fb_signin" action="<c:url value="/signin/facebook" />" method="post">
+                      <fb:login-button perms="email,publish_stream,offline_access" onlogin="signInWithFacebook();" v="2"
+                          length="long">Sign in with Facebook</fb:login-button>
+                  </form>
+                   <script>
+                  if(FB) {
+                      FB.requireSessionThenGoTo = function(url) {
+                          FB.getLoginStatus(function(response) {
+                              if (response.session) {
+                                  window.location = url;
+                              } else {
+                                  FB.login(function(response) {
+                                      if (response.session) {
+                                          window.location = url;
+                                      }
+                                  });
+                              }
                           });
-                    }
-                </script>
-                <div id="fb-root"></div>
-                <form id="fb_signin" action="<c:url value="/signin/facebook" />" method="post">
-                    <fb:login-button perms="email,publish_stream,offline_access" onlogin="signInWithFacebook();" v="2"
-                        length="long">Sign in with Facebook</fb:login-button>
-                </form>
-                 <script>
-                if(FB) {
-                    FB.requireSessionThenGoTo = function(url) {
-                        FB.getLoginStatus(function(response) {
-                            if (response.session) {
-                                window.location = url;
-                            } else {
-                                FB.login(function(response) {
-                                    if (response.session) {
-                                        window.location = url;
-                                    }
-                                });
-                            }
-                        });
-                    };
+                      };
 
-                    FB.logoutThenGoTo = function(url) {
-                        FB.logout(function(response) {
-                            window.location = url;
-                        });
-                    };
-                }
-                </script>
-                <script type='text/javascript'>
-                    FB.init({appId: '102345790957', status: true, cookie: true, xfbml: true});
-                    FB.Event.subscribe('auth.sessionChange', function(response) { if (response.session) {} else {} });
-                </script>
-        </div>
+                      FB.logoutThenGoTo = function(url) {
+                          FB.logout(function(response) {
+                              window.location = url;
+                          });
+                      };
+                  }
+                  </script>
+                  <script type='text/javascript'>
+                      FB.init({appId: '102345790957', status: true, cookie: true, xfbml: true});
+                      FB.Event.subscribe('auth.sessionChange', function(response) { if (response.session) {} else {} });
+                  </script>
+          </div>
+         </c:if>
     </div>

encuestame-war/src/main/webapp/resource/css/default.css

 }
 
 #mainWrapper {
-    margin: 0em 10em auto;
+    margin: 0em 4em auto;
+    width: 90%;
 }
 
 .wrapper {
 }
 
 .defaultMarginWrapper{
-    margin: 0 8%;
+
 }
 
 .defaultDisplayBlock{

encuestame-war/src/main/webapp/resource/css/menu.css

 }
 
 .menuWrapper {
-    margin: 0 10em auto;
     background-color: #444444;
     border-radius: 0px 0px 2px 2px;
     -moz-border-radius: 0px 0px 2px 2px;

encuestame-war/src/main/webapp/resource/css/public.css

 }
 
 div.headerOptions{
-
-}
-
-div.headerOptions{
-    float: right;
     width: auto;
     text-align: right;
+    padding: 0 5px;
+    height: 30px;
+}
+
+div.headerOptions span{
+    display: inline-block;
 }
 
 div.headerOptions span.link{
     padding-left: 5px;
     padding-right: 5px;
+    margin: 4px 4px 3px 0;
 }
 
 div.headerOptions span.link a{
     box-shadow: 0px 1px 0px #C1C1C1;
     -webkit-box-shadow: 0px 1px 0px #C1C1C1;
     -moz-box-shadow: 0px 1px 0px #C1C1C1;
-    margin: 0 20em auto;
 }
 
-.logoSmallEncuestame{
-     background-image: url(../images/logos/encuestame_header_grey.jpg);
-     background-repeat: no-repeat;
-     height: 24px;
+#publicLineHeader div.logo{
      margin-left: 20px;
      width: 128px;
-     display: inline-block;
+     float: left;
 }
 
 div.logoEncuestame{

encuestame-war/src/main/webapp/resource/js/encuestame.profile.js

 dependencies ={
     layers:  [
         {
-            name: "encuestame-widgets.js",
+            name: "encuestame-commons.js",
+            //copyrightFile: "../../encuestame-war/apache.txt",
             dependencies: [
-                "encuestame.org.core.contextWidget",
-                "encuestame.org.core.commons",
                 "encuestame.org.core.commons.tweetPoll.TweetPoll",
                 "encuestame.org.core.commons.tweetPoll.TweetPollList",
                 "encuestame.org.core.commons.tweetPoll.TweetPollListDetail",
                 "encuestame.org.core.commons.tweetPoll.HashTags",
                 "encuestame.org.core.commons.tweetPoll.Answers",
                 "encuestame.org.core.commons.poll.Poll",
-                "encuestame.org.core.commons.signup.SignupProfile",
                 "encuestame.org.core.commons.social.SocialAccounts",
                 "encuestame.org.core.commons.dashboard.Dashboard",
                 "encuestame.org.core.commons.dashboard.chart.DashboardPie",
                 "encuestame.org.core.map.Map",
                 "encuestame.org.core.commons.profile.ProfileMenu",
                 "encuestame.org.core.commons.profile.Profile",
-                "encuestame.org.core.commons.search.SearchMenu",
                 "encuestame.org.core.commons.dashboard.DashBoardMenu",
-                "encuestame.org.core.commons.security.Login",
                 "encuestame.org.core.commons.security.Password",
+                "encuestame.org.core.admon.location.Locations",
                 "encuestame.org.core.commons.error.ErrorSessionHandler",
                 "encuestame.org.core.commons.error.ErrorConexionHandler",
-                "encuestame.org.core.commons.error.ErrorHandler"
+                "encuestame.org.core.commons.error.ErrorHandler",
+                "encuestame.org.core.commons.dialog.Confirm",
+                "encuestame.org.core.commons.dialog.Dialog",
+                "encuestame.org.core.commons.signup.SignupProfile",
+                "encuestame.org.core.commons.security.Login",
+                "encuestame.org.core.shared.utils.Suggest",
+                "encuestame.org.core.shared.utils.Table",
+                "encuestame.org.core.commons.error.AbstractErrorHandler",
+                "encuestame.org.core.commons",
+                "encuestame.org.core.commons.search.SearchMenu",
+                "encuestame.org.core.commons.search.SearchSuggestItem"
                 ]
-            }/*,
+            }
+          /*,
             {
                 name: "../dijit/dijit.js",
                 dependencies: [

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/admon/location/Locations.js

-dojo.provide("encuestame.org.core.commons.dashboard.Dashboard");
+dojo.provide("encuestame.org.core.admon.location.Locations");
 
 dojo.require("dijit._Templated");
 dojo.require("dijit._Widget");
 
 dojo.declare(
-    "encuestame.org.core.commons.dashboard.Dashboard",
+    "encuestame.org.core.admon.location.Locations",
     [dijit._Widget, dijit._Templated],{
-        templatePath: dojo.moduleUrl("encuestame.org.core.commons.dashboard", "template/Dashboard.inc"),
+        templatePath: dojo.moduleUrl("encuestame.org.core.admon.location", "template/location.inc"),
 
         widgetsInTemplate: true,
 

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/admon/location/template/location.inc

 <div>
-DashBoard Widget Test.
+    DashBoard Widget Test.
 </div>

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons.js

 encuestame.service = {};
 encuestame.service.offline = false;
 encuestame.service.timeout = 20000;
-encuestame.contextDefault = "/encuestame";
+encuestame.contextDefault = config.contextPath;
 encuestame.signin = encuestame.contextDefault+"/signin.jspx";
 
 /**
  * TODO: review if this works properly.
  */
 encuestame.contextWidget = function(){
-    var contextWidget2 = dijit.byId("contextWidget");
-    //console.debug("Context Widget: ", contextWidget2)
-    if(contextWidget2){
-        //console.debug("Found Context Path");
-        return contextWidget2.contextPath;
-    } else {
-        //console.debug("Not found, default context");
+        console.debug("Not found, default context");
         return encuestame.contextDefault;
-    }
 };
 
 encuestame.service.list = {};

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/search/SearchMenu.js

 dojo.declare(
     "encuestame.org.core.commons.search.SearchMenu",
     [encuestame.org.core.shared.utils.SuggestItem],{
-        templatePath: dojo.moduleUrl("encuestame.org.core.commons.search", "templates/searchMenu.inc"),
+      /*
+       * template.
+       */
+      templatePath: dojo.moduleUrl("encuestame.org.core.commons.search", "templates/searchMenu.inc"),
 
         /*
          * enable widget on template.
                 { url :encuestame.service.search.suggest,
                   addButton : false,
                   hideLabel: true,
-                  query :  {itemSearchTitle : "*"}});
+                  query :  {itemSearchTitle : "*"},
+                  templatePath: dojo.moduleUrl("encuestame.org.core.commons.search", "templates/suggest.inc")});
             //override build row method.
             this.suggestWidget.buildRow = dojo.hitch(this, function(data){
                   console.info("suggest buildRow...", data);

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/search/templates/searchMenu.inc

-<div>
+<span>
    <div dojoAttachPoint="_suggest"></div>
     <div class="wrapperHashTagItems">
         <div dojoAttachPoint="_items"></div>
     </div>
-</div>
+</span>

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/search/templates/suggest.inc

+<div class="suggest">
+    <label  dojoAttachPoint="_label">${label}</label>
+    <input type="text" dojoAttachPoint="_suggest"
+           dojoType="dijit.form.TextBox"
+           trim="true" class="inputClass"></input>
+    <button id="suggestButton" type="button" style="display: none;" dojoAttachPoint="_suggestButton">
+    Add</button>
+    <div class="suggestBox" style="opacity :0;"
+            dojoAttachPoint="_suggestItems">
+    </div>
+</div>

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/commons/security/Login.js

 dojo.declare(
     "encuestame.org.core.commons.security.Login",
     [dijit._Widget, dijit._Templated],{
-        templatePath: dojo.moduleUrl("encuestame.org.core.commons.security", "templates/searchMenu.inc"),
+        templatePath: dojo.moduleUrl("encuestame.org.core.commons.security", "templates/login.inc"),
 
         widgetsInTemplate: true
 

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/contextWidget.js

-dojo.provide("encuestame.org.core.contextWidget");
-
-dojo.require("dijit._Templated");
-dojo.require("dijit._Widget");
-
-dojo.declare(
-    "encuestame.org.core.contextWidget",
-    [dijit._Widget, dijit._Templated],{
-        templateString: "<div/>",
-        contextPath : "/encuestame",
-        postCreate : function(){
-            console.debug("Context ", this.contextPath)
-        }
-    }
-);

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/shared/utils/Suggest.js

 dojo.declare(
     "encuestame.org.core.shared.utils.Suggest",
     [dijit._Widget, dijit._Templated],{
-        templatePath: dojo.moduleUrl("encuestame.org.core.shared.utils", "template/suggest.inc"),
+
+      templatePath: dojo.moduleUrl("encuestame.org.core.shared.utils", "template/suggest.inc"),
 
         /** Allow other widgets in the template. **/
         widgetsInTemplate: true,
                 );
                 this.callSuggest();
                 if(this.addButton){
-                    dojo.style(this._suggestButton, "display", "block");
-                    this.buttonWidget = new dijit.form.Button({
-                        label: "Add",
-                        onClick: dojo.hitch(this, function(event) {
-                            dojo.stopEvent(event);
-                            this.processSelectedItemButton();
-                        })
-                    },
-                    this._suggestButton);
-                    console.debug(this.buttonWidget);
+                  //check if node exist.
+                  if (this._suggestButton) {
+                      dojo.style(this._suggestButton, "display", "block");
+                      this.buttonWidget = new dijit.form.Button({
+                          label: "Add",
+                          onClick: dojo.hitch(this, function(event) {
+                              dojo.stopEvent(event);
+                              this.processSelectedItemButton();
+                          })
+                      },
+                      this._suggestButton);
+                      console.debug(this.buttonWidget);
+                  }
                 }
                 if (this.hideLabel) {
-                   dojo.addClass(this._label,"defaultDisplayHide");
+                   if(this._label) {
+                     dojo.addClass(this._label,"defaultDisplayHide");
+                   }
                 }
             } else {
                 console.error("Error");

encuestame-war/src/main/webapp/resource/js/encuestame/org/core/shared/utils/template/suggest.inc

 <div class="suggest">
-    <label  dojoAttachPoint="_label">${label}</label><br></br>
     <input type="text" dojoAttachPoint="_suggest"
            dojoType="dijit.form.TextBox"
            trim="true" class="inputClass"></input>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.