[fusion-commits] r1390 - in trunk: . lib
svn_fusion at osgeo.org
svn_fusion at osgeo.org
Tue May 6 14:55:41 EDT 2008
Author: madair
Date: 2008-05-06 14:55:40 -0400 (Tue, 06 May 2008)
New Revision: 1390
Modified:
trunk/build.xml
trunk/lib/fusion.js
Log:
closes #53: makes pre-parsing and including ApplicationDefinition optional.
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-05-06 17:13:10 UTC (rev 1389)
+++ trunk/build.xml 2008-05-06 18:55:40 UTC (rev 1390)
@@ -79,7 +79,6 @@
<property name="deploy.home" value="${env.HTDOCS}/${app.name}"/>
<property name="dist.home" value="${basedir}/dist"/>
<property name="docs.home" value="${build.home}/docs"/>
- <property name="appDef" value="${basedir}/templates/mapguide/standard/ApplicationDefinition.xml"/>
<!-- ==================== External Dependencies =========================== -->
@@ -171,10 +170,9 @@
excludes="WidgetInfoTemplate.xml widgetInfo.xsl"/>
</target>
-<!-- =================== single file build ================================== -->
- <target description="single file build" name="singleFile" depends="prepare">
- <echo message="preparing single file build for ${appDef}"/>
- <delete dir="${build.home}/lib/fusionSF.js"/>
+<!-- =================== prepare AppDef for single file build ================================== -->
+ <target description="convert AppDef to JSON" name="appDef2Json" if="appDef">
+ <echo message="converting ${appDef} to JSON"/>
<delete dir="${build.home}/appDefFileset.xml"/>
<!-- generate the list of files for this Application and load as a property -->
@@ -187,12 +185,18 @@
<!-- convert the application definition file to JSON -->
<exec executable="php" os="Windows Vista, Windows XP"
- dir="${build.home}\common\php"
output="${build.home}/appDef.json">
- <arg line="Xml2JSON.php --file='${appDef}'"/>
+ <arg line="common\php\Xml2JSON.php --file='${appDef}'"/>
</exec>
- <!-- now merge everything into a single file -->
+ </target>
+
+<!-- =================== single file build ================================== -->
+ <target description="single file build" name="singleFile" depends="clean,prepare,appDef2Json">
+ <echo message="preparing single file build for ${appDef}"/>
+ <delete dir="${build.home}/lib/fusionSF.js"/>
+
+ <!-- merge everything into a single file -->
<concat destfile="${build.home}/lib/fusionSF.js" outputencoding="UTF-8">
<filelist dir="${build.home}/lib"
files=" SingleFile.js
Modified: trunk/lib/fusion.js
===================================================================
--- trunk/lib/fusion.js 2008-05-06 17:13:10 UTC (rev 1389)
+++ trunk/lib/fusion.js 2008-05-06 18:55:40 UTC (rev 1390)
@@ -238,6 +238,7 @@
var queryAppDef = this.getQueryParam('ApplicationDefinition');
if (queryAppDef) {
this.applicationDefinitionURL = queryAppDef.split('+').join(' ');
+ this.appDefJson = null; //wipe out any preloaded AppDef in a single file build
} else {
this.applicationDefinitionURL = 'ApplicationDefinition.xml';
}
@@ -772,6 +773,14 @@
}
},
+ getSearchCategories: function() {
+ if (this.applicationDefinition) {
+ return this.applicationDefinition.searchCategories;
+ } else {
+ return {};
+ }
+ },
+
getApplicationDefinitionURL: function() { return this.applicationDefinitionURL; },
/**
@@ -805,7 +814,7 @@
require: function(url) { this.queueScript(url); },
- reportError: function(o) { this.triggerEvent(Fusion.Event.FUSION_ERROR, o); },
+ reportError: function(o) { console.log(o.message); this.triggerEvent(Fusion.Event.FUSION_ERROR, o); },
unitFromName: function(unit) {
switch(unit.toLowerCase()) {
More information about the fusion-commits
mailing list