Commits

Juan Carlos Picado Herrera committed 64f23c2

ShrinkSafe completed.

git-svn-id: http://svn.encuesta.me/trunk/encuestame@90339e2479b-dd58-4041-9f67-69c9b71f0610

Comments (0)

Files changed (21)

 #!/bin/bash
-DOJO_PATH=/home/jpicado/workspaceTrunk/dojo
+DOJO_PATH=dojo
 SVN_DOJO=http://svn.dojotoolkit.org/src/tags/release-1.5.0/
 
 echo 'Building Dojo'
 
 function createSymbolic {
-        rm encuestame-war/src/main/webapp/resource/js/dojo
-        rm encuestame-war/src/main/webapp/resource/js/dojox
-        rm encuestame-war/src/main/webapp/resource/js/dijit
-        cp -Rf ${DOJO_PATH}/dojo encuestame-war/src/main/webapp/resource/js/
-        cp -Rf ${DOJO_PATH}/dojox encuestame-war/src/main/webapp/resource/js/
-        cp -Rf ${DOJO_PATH}/dijit encuestame-war/src/main/webapp/resource/js/
+        if [ -d ${DOJO_PATH} ]; then
+            if [ -d encuestame-war/src/main/webapp/resource/js/dojo ]; then
+                rm -Rf encuestame-war/src/main/webapp/resource/js/dojo
+            fi
+
+            if [ -d encuestame-war/src/main/webapp/resource/js/dojox ]; then
+                rm -Rf encuestame-war/src/main/webapp/resource/js/dojox
+            fi
+
+            if [ -d encuestame-war/src/main/webapp/resource/js/dijit ]; then
+                rm -Rf encuestame-war/src/main/webapp/resource/js/dijit
+            fi
+            cp -Rf ${DOJO_PATH}/dojo encuestame-war/src/main/webapp/resource/js/
+            cp -Rf ${DOJO_PATH}/dojox encuestame-war/src/main/webapp/resource/js/
+            cp -Rf ${DOJO_PATH}/dijit encuestame-war/src/main/webapp/resource/js/
+        fi
 }
 
 

encuestame-business/src/main/resources/encuestame-security-context.xml

     <security:intercept-url pattern="index.jsp" filters="none" />
 
     <!-- Public Paths -->
-    <security:intercept-url pattern="/index.html" filters="none"/>
-    <security:intercept-url pattern="/error.xhtml" filters="none"/>
+    <security:intercept-url pattern="/index.jspx" filters="none"/>
+    <security:intercept-url pattern="/error.jspx" filters="none"/>
     <security:intercept-url pattern="/home" filters="none"/>
-    <security:intercept-url pattern="/users.html" filters="none"/>
-    <security:intercept-url pattern="/tags.html" filters="none"/>
+    <security:intercept-url pattern="/users.jspx" filters="none"/>
+    <security:intercept-url pattern="/tags.jspx" filters="none"/>
 
     <!-- Admon Paths -->
     <security:intercept-url pattern="/admon/**/*" access="ENCUESTAME_ADMIN, ENCUESTAME_USER"/>
     <!-- Account Paths -->
-    <security:intercept-url pattern="/user/signin.html" access="ENCUESTAME_ANONYMOUS"/>
-    <security:intercept-url pattern="/user/forgot.html" access="ENCUESTAME_ANONYMOUS" />
-    <security:intercept-url pattern="/user/signup.html" access="ENCUESTAME_ANONYMOUS"/>
+    <security:intercept-url pattern="/user/signin.jspx" access="ENCUESTAME_ANONYMOUS"/>
+    <security:intercept-url pattern="/user/forgot.jspx" access="ENCUESTAME_ANONYMOUS" />
+    <security:intercept-url pattern="/user/signup.jspx" access="ENCUESTAME_ANONYMOUS"/>
 
     <security:intercept-url pattern="/user/logout" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"/>
 
     <!-- Super Admin -->
-    <security:intercept-url pattern="/superAdmin.html" access="ENCUESTAME_SUPER"/>
+    <security:intercept-url pattern="/superAdmin.jspx" access="ENCUESTAME_SUPER"/>
 
     <!-- Shared areas -->
     <security:intercept-url pattern="/account/**/*" access="ENCUESTAME_USER"/>
-    <security:intercept-url pattern="/user/lists.html" access="ENCUESTAME_USER"/>
-    <security:intercept-url pattern="/user/social.html" access="ENCUESTAME_USER"/>
+    <security:intercept-url pattern="/user/lists.jspx" access="ENCUESTAME_USER"/>
+    <security:intercept-url pattern="/user/social.jspx" access="ENCUESTAME_USER"/>
 
     <!-- Surveys / Poll / TweetPoll Paths -->
-    <security:intercept-url pattern="/tweetpoll.html" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"   />
-    <security:intercept-url pattern="/poll.html" access="ENCUESTAME_USER"/>
-    <security:intercept-url pattern="/survey.html" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"/>
+    <security:intercept-url pattern="/tweetpoll.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"   />
+    <security:intercept-url pattern="/poll.jspx" access="ENCUESTAME_USER"/>
+    <security:intercept-url pattern="/survey.jspx" access="ENCUESTAME_USER, ENCUESTAME_EDITOR"/>
 
     <!-- Vote Paths
     <security:intercept-url pattern="/tweet/*" access="ENCUESTAME_USER" />

encuestame-core/src/main/java/org/encuestame/core/cron/IndexRebuilder.java

     public void reindexEntities() throws Exception {
         log.debug("reindexEntities");
         FullTextSession fullTextSession = org.hibernate.search.Search.getFullTextSession(getHibernateTemplate().getSessionFactory().openSession());
-        reindex(fullTextSession, Question.class);
+        //reindex(fullTextSession, Question.class);
         reindex(fullTextSession, TweetPollResult.class);
         reindex(fullTextSession, HashTag.class);
         fullTextSession.close();
     /**
      * @param hibernateTemplate the hibernateTemplate to set
      */
-    public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
+    public void setHibernateTemplate(final HibernateTemplate hibernateTemplate) {
         this.hibernateTemplate = hibernateTemplate;
     }
 

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

 #Path if login fail
 spring.sec.login.error=/user/signin?failure=true
 #Path if recourse is denided
-spring.sec.login.denied=/error.html
+spring.sec.login.denied=/error.jspx
 #Log out
 spring.sec.logout.url=/user/logout
 #After log out the path will send user

encuestame-war/dojo.properties

+dojo.path=/home/jpicado

encuestame-war/pom.xml

                     <phase>compile</phase>
                     <configuration>
                         <classpath>
-                          <pathelement location="${basedir}/lib/js.jar"/>
-                          <pathelement location="${basedir}/lib/shrinksafe.jar"/>
+                          <pathelement location="../dojo/util/shrinksafe/js.jar"/>
+                          <pathelement location="../dojo/util/shrinksafe/shrinksafe.jar"/>
                         </classpath>
+                        <property file="${basedir}/dojo.properties"/>
                         <target unless="build">
                             <java
                              fork="true"
                              failonerror="true"
-                             dir="/home/jpicado/workspaceTrunk/dojo/util/buildscripts"
+                             dir="../dojo/util/buildscripts"
                              classname="org.mozilla.javascript.tools.shell.Main">
                             <classpath>
-                              <pathelement location="${basedir}/lib/js.jar"/>
-                              <pathelement location="${basedir}/lib/shrinksafe.jar"/>
+                              <pathelement location="../dojo/util/shrinksafe/js.jar"/>
+                              <pathelement location="../dojo/util/shrinksafe/shrinksafe.jar"/>
                             </classpath>
                             <jvmarg value="-Xmx512M"/>
-                            <arg value="/home/jpicado/workspaceTrunk/dojo/util/buildscripts/build.js"/>
+                            <arg value="build.js"/>
                             <arg value="version=1.5.0"/>
-                            <arg value="profileFile=/home/jpicado/workspaceTrunk/encuestame/encuestame-war/src/main/webapp/resource/js/encuestame.profile.js"/>
+                            <arg value="profileFile=${basedir}/src/main/webapp/resource/js/encuestame.profile.js"/>
                             <arg value="action=clean,release"/>
-                            <arg value="releaseDir=/home/jpicado/workspaceTrunk/encuestame/encuestame-war/target/dojo-compiled"/>
+                            <arg value="releaseDir=${project.build.directory}/dojo-compiled"/>
                             <arg value="optimize=shrinksafe"/>
                             <arg value="layerOptimize=shrinksafe"/>
                             <arg value="cssOptimize=comments"/>
                             <arg value="mini=true"/>
                           </java>
+                          <delete includeEmptyDirs="true" verbose="true">
+                               <fileset dir="${basedir}/target/dojo-compiled/" includes="**/.svn" defaultexcludes="false"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/tests/**/"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/demos/**/"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="util/**"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/*.psd"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/*.fla"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/*.svg"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/*.as"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dojo" includes="**/*.swf"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/dijit/themes/" excludes="**/tundra/**/"/>
+                               <fileset dir="${basedir}/target/dojo-compiled/dojo/" includes="**/*.uncompressed.js"/>
+                           </delete>
                           <echo message="Dojo optimized." />
                         </target>
                     </configuration>
             <artifactId>maven-war-plugin</artifactId>
             <version>2.1.1</version>
             <configuration>
-                <!--
-                    Use this to include a selection of jars that will be included in the
-                    WAR
-                -->
                 <packagingIncludes>
                     WEB-INF/lib/*,
-                    **/*.xml,
+                    WEB-INF/**/*.xml,
+                    resource/css/**/*,
+                    resource/images/**/*,
+                    resource/js/dojo/**/*,
+                    resource/js/dijit/**/*,
+                    resource/js/dojox/**/*,
                     **/*.properties,
                     **/*.class,
-                    **/*.png,
-                    **/*.gif,
                     **/*.ico,
-                    **/*.jpg,
                     **/*.xsd,
-                    **/*.css,
-                    **/*.jss,
-                    **/*.jsp</packagingIncludes>
+                    **/*.jsp
+                </packagingIncludes>
                 <archive>
                     <manifest>
                         <addClasspath>true</addClasspath>
                         <classpathPrefix>lib/</classpathPrefix>
                     </manifest>
                 </archive>
+                <webResources>
+                   <resource>
+                        <directory>${project.build.directory}/dojo-compiled/dojo/</directory>
+                        <targetPath>resource/js</targetPath>
+                    </resource>
+                </webResources>
             </configuration>
         </plugin>
             <plugin>

encuestame-war/src/main/webapp/WEB-INF/jsp/admon/groups.jsp

   dojo.require("dijit.form.TimeTextBox");
   dojo.require("dijit.form.Button");
   dojo.require("dijit.form.DateTextBox");
-  dojo.require("encuestame.org.class.commons.dashboard.Dashboard");
+  dojo.require("encuestame.org.core.commons.dashboard.Dashboard");
 </script>
 
 <div>
 
-    <div dojoType="encuestame.org.class.commons.dashboard.Dashboard"></div>
+    <div dojoType="encuestame.org.core.commons.dashboard.Dashboard"></div>
 
     <button dojoType="dijit.form.Button" onclick="dijit.byId('dialog1').show()">Show Dialog</button>
 

encuestame-war/src/main/webapp/WEB-INF/jsp/admon/project.jsp

   dojo.require("dijit.form.TimeTextBox");
   dojo.require("dijit.form.Button");
   dojo.require("dijit.form.DateTextBox");
-  dojo.require("encuestame.org.class.admon.project.Projects");
+  dojo.require("encuestame.org.core.admon.project.Projects");
 </script>
 <div>
-  <div dojoType="encuestame.org.class.admon.project.Projects"></div>
+  <div dojoType="encuestame.org.core.admon.project.Projects"></div>
 </div>
 <%@ include file="/WEB-INF/jsp/includes/endBody.jsp" %>
 <%@ include file="/WEB-INF/jsp/includes/validate.jsp" %>

encuestame-war/src/main/webapp/WEB-INF/jsp/admon/users.jsp

 <%@ include file="/WEB-INF/jsp/includes/initPage.jsp" %>
 <%@ include file="/WEB-INF/jsp/includes/initBody.jsp" %>
 <script type="text/javascript">
-  dojo.require("encuestame.org.class.admon.user.Users");
+  dojo.require("encuestame.org.core.admon.user.Users");
 </script>
 <div class="admonWrapper">
-    <div dojoType="encuestame.org.class.admon.user.Users"></div>
+    <div dojoType="encuestame.org.core.admon.user.Users"></div>
 </div>
 </div>
 <%@ include file="/WEB-INF/jsp/includes/endBody.jsp" %>

encuestame-war/src/main/webapp/WEB-INF/jsp/dashboard.jsp

 <%@ include file="/WEB-INF/jsp/includes/initPage.jsp" %>
 <%@ include file="/WEB-INF/jsp/includes/initBody.jsp" %>
 <script type="text/javascript">
-  dojo.require("encuestame.org.class.commons.dashboard.chart.DashboardPie");
-  dojo.require("encuestame.org.class.commons.dashboard.chart.DashboardColumn2D");
-  dojo.require("encuestame.org.class.commons.dashboard.chart.DashboardLine");
-  dojo.require("encuestame.org.class.commons.dashboard.Dashboard");
+  dojo.require("encuestame.org.core.commons.dashboard.chart.DashboardPie");
+  dojo.require("encuestame.org.core.commons.dashboard.chart.DashboardColumn2D");
+  dojo.require("encuestame.org.core.commons.dashboard.chart.DashboardLine");
+  dojo.require("encuestame.org.core.commons.dashboard.Dashboard");
 </script>
 
 <div>
-    <div dojoType="encuestame.org.class.commons.dashboard.Dashboard"></div>
-    <div id="pie" dojoType="encuestame.org.class.commons.dashboard.chart.DashboardPie"></div>
-    <div id="column" dojoType="encuestame.org.class.commons.dashboard.chart.DashboardColumn2D"></div>
-    <div id="line" dojoType="encuestame.org.class.commons.dashboard.chart.DashboardLine"></div>
+    <div dojoType="encuestame.org.core.commons.dashboard.Dashboard"></div>
+    <div id="pie" dojoType="encuestame.org.core.commons.dashboard.chart.DashboardPie"></div>
+    <div id="column" dojoType="encuestame.org.core.commons.dashboard.chart.DashboardColumn2D"></div>
+    <div id="line" dojoType="encuestame.org.core.commons.dashboard.chart.DashboardLine"></div>
     <%=request.getContextPath()%>
 </div>
 

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

 <body class="tundra">
-<div id="contextWidget" dojoType="encuestame.org.class.contextWidget" contextPath="<%=request.getContextPath()%>"></div>
+<div id="contextWidget" dojoType="encuestame.org.core.contextWidget" contextPath="<%=request.getContextPath()%>"></div>
 <%@ include file="/WEB-INF/jsp/includes/headerLogged.jsp" %>

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

     <script type="text/javascript">
          dojo.require("dijit.dijit");
          dojo.require("dojo.parser");
-         dojo.require("encuestame.org.class.contextWidget");
+         dojo.require("encuestame.org.core.contextWidget");
+         dojo.require("encuestame.org.core.commons.notifications.Notification");
     </script>
     <style type="css">
         img{ border:0px;}

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>
 <style type="text/css">
       @import "<%=request.getContextPath()%>/resource/js/dijit/themes/tundra/tundra.css";
       @import "<%=request.getContextPath()%>/resource/js/dojo/resources/dojo.css"

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

-<script type="text/javascript">
-   dojo.require("encuestame.org.class.commons.notifications.Notification");
-</script>
  <div class="menuWrapper">
     <ul>
         <li>
         <li class="item"><a href="<%=request.getContextPath()%>//survey.jspx">Surveys</a></li>
     </ul>
     <div style="float: right;">
-        <div dojoType="encuestame.org.class.commons.notifications.Notification" delay="10000"></div>
+        <div dojoType="encuestame.org.core.commons.notifications.Notification" delay="10000"></div>
     </div>
     <br style="clear: left" />
     </div>

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

-<script src="<%=request.getContextPath()%>/resource/js/encuestame-login.js" type="text/javascript"></script>

encuestame-war/src/main/webapp/WEB-INF/jsp/tweetpoll.jsp

 <%@ include file="/WEB-INF/jsp/includes/initPage.jsp" %>
 <%@ include file="/WEB-INF/jsp/includes/initBody.jsp" %>
 <script type="text/javascript">
-    dojo.require("encuestame.org.class.commons.tweetPoll.TweetPoll");
+    dojo.require("encuestame.org.core.commons.tweetPoll.TweetPoll");
 </script>
 <div class="defaultMarginWrapper">
-    <div id="line" dojoType="encuestame.org.class.commons.tweetPoll.TweetPoll"></div>
+    <div id="line" dojoType="encuestame.org.core.commons.tweetPoll.TweetPoll"></div>
 </div>
 </div>
 <%@ include file="/WEB-INF/jsp/includes/endBody.jsp" %>

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

 dependencies ={
     layers:  [
         {
-            name: "encuestame.js",
+            name: "encuestame-widgets.js",
             dependencies: [
                 "encuestame.org.core.contextWidget",
                 "encuestame.org.core.commons",
                 "encuestame.org.core.commons.dashboard.chart.DashboardLine",
                 "encuestame.org.core.commons.dashboard.chart.DashboardColumn2D",
                 "encuestame.org.core.admon.project.Projects",
+                "encuestame.org.core.commons.notifications.Notification",
                 "encuestame.org.core.admon.user.Users"
                 ]
-            }
+            }/*,
+            {
+                name: "../dijit/dijit.js",
+                dependencies: [
+                    "dijit.dijit"
+                ]
+            },
+            {
+                name: "../dijit/dijit-all.js",
+                layerDependencies: [
+                    "../dijit/dijit.js"
+                ],
+                dependencies: [
+                    "dijit.dijit-all"
+                ]
+            }*/
         ],
         prefixes: [
             ["encuestame", "/home/jpicado/workspaceTrunk/encuestame/encuestame-war/src/main/webapp/resource/js/encuestame"],

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

 <div class="hashTagWrapper">
     <div>
-        <div id="hashTagSuggest" dojoType="encuestame.org.class.shared.utils.Suggest"></div>
+        <div id="hashTagSuggest" dojoType="encuestame.org.core.shared.utils.Suggest"></div>
     </div>
 </div>

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

         </div>
         <div class="seccondSection" style="margin: 0 9%;">
             <div class="answers" style="float: left;">
-                <div dojoType="encuestame.org.class.commons.tweetPoll.Answers"></div>
+                <div dojoType="encuestame.org.core.commons.tweetPoll.Answers"></div>
             </div>
             <div class="hashTags" style="float: right;">
-                <div dojoType="encuestame.org.class.commons.tweetPoll.HashTags"></div>
+                <div dojoType="encuestame.org.core.commons.tweetPoll.HashTags"></div>
             </div>
         </div>
     </div>

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

 
 encuestame.service = {};
 encuestame.service.timeout = 5000;
-
+encuestame.contextDefault = "/encuestame";
 /**
  * Json Get Call.
  */
 };
 
 encuestame.contextWidget = function(){
-    var contextWidget2 = dojo.byId("contextWidget");
+    var contextWidget2 = dijit.byId("contextWidget");
+    console.debug("Context Widget: ", contextWidget2)
     if(contextWidget2){
-        return contextWidget2.getAttribute("contextPath");
+        console.debug("Found Context Path");
+        return contextWidget2.contextPath;
     } else {
-        return "";
+        console.debug("Not found, default context");
+        return encuestame.contextDefault;
     }
 };
 

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

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