Commits

Juan Carlos Picado Herrera committed fa936a2

Optimized dojo compression, in progress, cometd is disabled right now

  • Participants
  • Parent commits 95ec95c

Comments (0)

Files changed (9)

File 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>

File 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";

File 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="mainWrapper">
         <div id="header">
             <tiles:insertAttribute name="header" />
         </div>
      </div>
 </body>
-</html>
+</html>

File 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: [

File 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,
 

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

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

File 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 = {};

File 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
 

File 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)
-        }
-    }
-);