diff --git a/jaggr-sample-web/WebContent/META-INF/MANIFEST.MF b/jaggr-sample-web/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 00000000..5e949512 --- /dev/null +++ b/jaggr-sample-web/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/jaggr-sample-web/WebContent/WEB-INF/aggrConfig.js b/jaggr-sample-web/WebContent/WEB-INF/aggrConfig.js new file mode 100644 index 00000000..ca304df0 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/aggrConfig.js @@ -0,0 +1,53 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ + +// This file is AMD Aggregator config for the Aggregator sample application +{ + baseUrl:'jaggrWeb', + + packages: [ + { + name: 'dojo', + location: 'classPath:///WebContent/source_1.8.0-20120830-IBM_dojo/dojo' + }, + { + name: 'dijit', + location: 'classPath:///WebContent/source_1.8.0-20120830-IBM_dojo/dijit' + }, + { + name: 'dojox', + location: 'classPath:///WebContent/source_1.8.0-20120830-IBM_dojo/dojox' + } + + ], + paths: { + }, + + textPluginDelegators: ["js/css"], + + deps: ["js/bootstrap"], + + depsIncludeBaseUrl: true, // include baseUrl in scan for dependencies + + inlinedImageSizeThreshold: 0, // max image size to inline in CSS + + lazyDetection: false, + + //notice: 'embed.txt', + + cacheBust: '${project.version}' // This is a maven variable, replaced at build time (see pom file for filtered resources). + // You have other options for variable replacement in this file such as "scoped-variables" (see wiki for more info) +} diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/colors.less b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/colors.less new file mode 100644 index 00000000..8435af69 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/colors.less @@ -0,0 +1,17 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ + +@back: lightblue; \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/LazyContentPane.js b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/LazyContentPane.js new file mode 100644 index 00000000..fa4a5292 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/LazyContentPane.js @@ -0,0 +1,73 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ +define([ + "dojo/_base/lang", // lang + "dojo/_base/declare", // declare + "dijit/layout/ContentPane" // parent +], function(lang, declare, ContentPane){ + +// module: +// js/LazyContentPane +// summary: +// A demo container that sets its contents based on its title. + + + return declare("dijit.layout.LazyContentPane", [ContentPane], { + onShow: function() { + if (this.get('content') == '') { + this.set('content', this.onDownloadStart()); + + var title = this.get('title'); + if (title == 'Calendar') { + require(['dijit/Calendar'], lang.hitch(this, function(calendar) { + this.set('content', new calendar({})); + })); + } else if (title == 'Color Palette') { + require(['dijit/ColorPalette'], lang.hitch(this, function(colorPallete) { + this.set('content', '
'); + new colorPallete({}, this.containerNode.firstChild); + })); + } else if (title == 'Editor') { + require(['dijit/Editor'], lang.hitch(this, function(editor) { + this.set('content', ''); + new editor({ + plugins: ["bold","italic","|","cut","copy","paste","|","insertUnorderedList"] + }, this.containerNode.firstChild); + })); + } else if (title == 'Chart') { + // Chained requires for gfx are internal to the gfx module. + require([ + 'dojox/charting/Chart2D', + 'dojox/charting/themes/Wetland', + 'dojox/charting/axis2d/Default', + 'dojox/charting/plot2d/Default' + ], lang.hitch(this, function(chart, wetland) { + this.set('content', ''); + var c = new chart(this.containerNode.firstChild); + c.addPlot("default", {type: "StackedAreas", tension:3}) + .addAxis("x", {fixLower: "major", fixUpper: "major"}) + .addAxis("y", {vertical: true, fixLower: "major", fixUpper: "major", min: 0}) + .setTheme(wetland) + .addSeries("Series A", [1, 2, 0.5, 1.5, 1, 2.8, 0.4]) + .addSeries("Series B", [2.6, 1.8, 2, 1, 1.4, 0.7, 2]) + .addSeries("Series C", [6.3, 1.8, 3, 0.5, 4.4, 2.7, 2]) + .render(); + })); + } + } + } + }); +}); diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/bootstrap.js b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/bootstrap.js new file mode 100644 index 00000000..0186f00c --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/bootstrap.js @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ +define(["dojo/ready", + "dojo/parser", + "dijit/layout/TabContainer", + "js/LazyContentPane", + "js/css!dijit/themes/claro/claro.css", + "js/css!dijit/themes/claro/claro.css", + "js/css!sample.less", + "dojo/has!dojo-combo-api?combo/dojo/featureMap", + + /* + * preload selector lite implementation which is used by dojo/query and + * supports modern browsers. If the emulation library is required, it + * will be required by the loader. + */ + "dojo/selector/lite" +], function() { + return {}; +}); diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/css.js b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/css.js new file mode 100644 index 00000000..c9311ff4 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/css.js @@ -0,0 +1,142 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ +define([ + "dojo/_base/window", + "dojo/_base/html", + "dojo/dom-construct", + "dojo/has", + "dojo/text" +], function(dwindow, dhtml, domConstruct, has){ + /* + * module: + * css + * summary: + * This plugin handles AMD module requests for CSS files. Required modules are + * loaded by delegating to the dojo/text plugin and then inserting the CSS into + * a style sheet element that is appended to the HEAD element in the DOM, and + * the style element is returned as the value of the module. + * + * URLs for url(...) and @import statements in the CSS are fixed up to make them + * relative to the requested module's path. + * + * This plugin guarantees that style elements will be inserted into the DOM in + * the same order that the associated CSS modules are requested, except when a + * previously requested module is requested again. In other words, if + * stylesA.css is required before stylesB.css, then the styles for stylesA.css + * will be inserted into the DOM ahead of the styles for stylesB.css. This + * behavior ensures proper cascading of styles based on order of request. + */ + var + cache = {}, // Cache of style sheets that have been added to DOM + loading = [], // Ordered list of required modules that are loading. + waiting = {}, // List of modules that have loaded but are waiting on + // previously required modules before the style-sheet + // can be added to the DOM. + tokenId = 1, // Unique token identifier for a request + + head = dwindow.doc.getElementsByTagName("head")[0], + toAbsMid= has("dojo-loader") ? + function(id, require){ + var result = require.toAbsMid(id + "/x"); + return result.substring(0, result.length-2); + } : + function(id, require){ + return require.toUrl(id); + }, + + fixUrlsInCssFile = function(/*String*/filePath, /*String*/content){ + var rewriteUrl = function(url) { + // remove surrounding quotes and normalize slashes + url = url.replace(/[\'\"]/g,"").replace(/\\/g, "/").replace(/^\s\s*/, "").replace(/\s*\s$/, ""); + // only fix relative URLs. + if (url.charAt(0) != '/' && !/^[a-zA-Z]:\/\//.test(url)) { + url = filePath.slice(0, filePath.lastIndexOf("/") + 1) + url; + //Collapse .. and . + var parts = url.split("/"); + for(var i = parts.length - 1; i > 0; i--){ + if(parts[i] == "."){ + parts.splice(i, 1); + }else if(parts[i] == ".."){ + if(i != 0 && parts[i - 1] != ".."){ + parts.splice(i - 1, 2); + } + } + } + url = require.toUrl(parts.join("/")); // Apply dojo's cache bust (if any) + } + return url; + }; + content = content.replace(/url\s*\(([^#\n\);]+)\)/gi, function(match, url){ + return "url(\"" + rewriteUrl(url) + "\")"; + }); + content = content.replace(/@import\s+(url\()?([^\s;]+)(\))?/gi, function(match, prefix, url) { + return (prefix == "url(" ? match : ("@import \"" + rewriteUrl(url) + "\"")); + }); + return content; + }; + + return { + load: function(/*String*/id, /*Function*/parentRequire, /*Function*/load){ + var parts = id.split("!"), + url = parentRequire.toUrl(parts[0]), + absMid= toAbsMid(parts[0], parentRequire), + requestToken = "tok" + (tokenId++); // A unique id for this request + + // Add this module's token to the ordered list of modules currently loading. + loading.push(requestToken); + + parentRequire(["dojo/text!" + absMid], function(cssText){ + // Process modules in fifo order + if (requestToken === loading[0]) { + // this module is at the head of the list, so process it + loading.shift(); // remove from queue + delete waiting[requestToken]; // remove from waiting list, if there + } else { + // Other modules need to be processed before this one, so add to the + // waiting list and return without processing the module + waiting[requestToken] = {fn:arguments.callee, args:arguments}; + return; + } + // see if this module is already in the cache + var style = cache[absMid]; + if (!style) { + // create a new style element for this module and add it to the DOM + style = domConstruct.create("style", {}, head); + style.type = "text/css"; + dhtml.setAttr(style, "mid", absMid); + if (cssText && dojo.isString(cssText) && cssText.length) { + cssText = fixUrlsInCssFile(url, cssText); + if(style.styleSheet){ + style.styleSheet.cssText = cssText; + }else{ + style.appendChild(dwindow.doc.createTextNode(cssText)); + } + } + // Put in cache + cache[absMid] = style; + } + load(style); + + // Now that we're done processing this module, see if a waiting module + // is at the head of the queue and process it if there is. + if (loading.length && loading[0] in waiting) { + var o = waiting[loading[0]]; + o.fn.apply(this, o.args); + } + }); + } + }; +}); diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/loaderConfig.js b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/loaderConfig.js new file mode 100644 index 00000000..00e688ca --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/js/loaderConfig.js @@ -0,0 +1,95 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ +(function() { + var href = location.href, + isDebugLoader = /[&?]debugLoader=1/.test(href); + + // make sure we use the global require object + this.require = { + baseUrl: '/test', + packages: [ + { + name: 'dojo', + location: '../jaggr-dojo/dojo', + lib: '.' + }, + { + name: 'dijit', + location: '../jaggr-dojo/dijit', + lib: '.' + }, + { + name: 'dojox', + location: '../jaggr-dojo/dojox', + lib: '.' + } + ], + + paths: { + js: "res/js" + }, + + has: { + "dojo-error-api" : isDebugLoader, + "dojo-trace-api" : isDebugLoader, + "host-browser" : 1 + }, + + // Enable the desired loader tracing options + trace: { + "loader-inject":isDebugLoader, + "loader-inject-combo": isDebugLoader, + "loader-inject-combo-reject": isDebugLoader, + "loader-define":isDebugLoader, + "loader-exec-module":isDebugLoader, + //"loader-run-factory":isDebugLoader, + //"loader-finish-exec":isDebugLoader, + "loader-define-module":isDebugLoader + }, + + // This option only has meaning if has.dojo-timeout-api is enabled + waitSeconds: 10, + + combo: { + contextPath: "/jaggr-webSample/jaggr", + expandRequire: true, + // This is a maven variable, replaced at build time (see pom file for filtered resources). + cacheBust: '${project.version}' + }, + + deps: [ + "dojo/ready", + "dojo/parser", + "js/bootstrap" + ], + + callback: function(ready, parser) { + ready(function() { + parser.parse(); + }); + } + }; + + // get combo propery overrides from URL + for (var s in {optimize:0,expandRequire:0,showFilenames:0,noCache:0}) { + var regex = new RegExp("[&?]"+s+"=([^&]*)","i"); + var result = regex.exec(href) || []; + if (result.length > 1) { + require.combo[s] = result[1]; + } + } + +})(); diff --git a/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/sample.less b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/sample.less new file mode 100644 index 00000000..ee2f4123 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/classes/jaggrWeb/sample.less @@ -0,0 +1,21 @@ +/* + * (C) Copyright 2012, IBM Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * 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. + */ + +@import "colors.less"; + +body { + background: @back; +} diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.css.CSSModuleBuilder.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.css.CSSModuleBuilder.properties new file mode 100644 index 00000000..7a693052 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.css.CSSModuleBuilder.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.web.impl.modulebuilder.css.CSSModuleBuilder +extension=css \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.i18n.I18nModuleBuilder.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.i18n.I18nModuleBuilder.properties new file mode 100644 index 00000000..63fc333d --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.i18n.I18nModuleBuilder.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.modulebuilder.i18n.I18nModuleBuilder +extension=js \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.javascript.JavaScriptModuleBuilder.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.javascript.JavaScriptModuleBuilder.properties new file mode 100644 index 00000000..6eea4b49 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.javascript.JavaScriptModuleBuilder.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.modulebuilder.javascript.JavaScriptModuleBuilder +extension=js \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.properties new file mode 100644 index 00000000..33123867 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder +extension=less \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.text.TextModuleBuilder.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.text.TextModuleBuilder.properties new file mode 100644 index 00000000..8deed96c --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.modulebuilder.text.TextModuleBuilder.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.modulebuilder.text.TextModuleBuilder +extension=* \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.ClassPathResourceFactory.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.ClassPathResourceFactory.properties new file mode 100644 index 00000000..8d5faf44 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.ClassPathResourceFactory.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.resource.ClassPathResourceFactory +scheme=classPath \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.FileResourceFactory.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.FileResourceFactory.properties new file mode 100644 index 00000000..b058110d --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.FileResourceFactory.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.resource.FileResourceFactory +scheme=file \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.JarResourceFactory.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.JarResourceFactory.properties new file mode 100644 index 00000000..be5ca649 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.core.impl.resource.JarResourceFactory.properties @@ -0,0 +1,16 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.core.impl.resource.JarResourceFactory +scheme=jar \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.web.impl.transport.DojoHttpTransport.properties b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.web.impl.transport.DojoHttpTransport.properties new file mode 100644 index 00000000..f0bc84d1 --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/extensionPointsConf/com.ibm.jaggr.web.impl.transport.DojoHttpTransport.properties @@ -0,0 +1,17 @@ +# (C) Copyright 2012, IBM Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# 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. + +class=com.ibm.jaggr.web.impl.transport.DojoHttpTransport +path=combo +resourcesUri=classPath:///jaggrCore/js/ \ No newline at end of file diff --git a/jaggr-sample-web/WebContent/WEB-INF/web.xml b/jaggr-sample-web/WebContent/WEB-INF/web.xml new file mode 100644 index 00000000..1c22555e --- /dev/null +++ b/jaggr-sample-web/WebContent/WEB-INF/web.xml @@ -0,0 +1,45 @@ + + ++ * This method is called during aggregator intialization. Subclasses may + * override this method to initialize the aggregator using a different name. + * Use the public {@link AggregatorImpl#getName()} method to get the name of + * an initialized aggregator. + * + * @param configElem + * The configuration element. + * @return The aggregator name + */ + + public String getAggregatorName() { + // trim leading and trailing '/' + String alias = getInitParameter("alias");//$NON-NLS-1$ + while (alias.charAt(0) == '/') + alias = alias.substring(1); + while (alias.charAt(alias.length() - 1) == '/') + alias = alias.substring(0, alias.length() - 1); + return alias; + } + + /** + * Returns the init params for this aggregator + *
+ * This method is called during aggregator intialization. Subclasses may
+ * override this method to initialize the aggregator using different init
+ * params. Use the public {@link AggregatorImpl#getInitParams()} method to
+ * get the init params for an initialized aggregator.
+ *
+ * @param configElem
+ * The configuration element.
+ * @return The init params
+ */
+
+ public InitParams getInitParamsFromServletConfig() {
+
+ List
+ * This method is called during aggregator intialization. Subclasses may
+ * override this method to initialize the aggregator using a different
+ * working directory. Use the public {@link #getWorkingDirectory()} method
+ * to get the working directory from an initialized aggregator.
+ *
+ * @param configElem
+ * The configuration element. Not used by this class but provided
+ * for use by subclasses.
+ * @return The {@code File} object for the working directory
+ * @throws FileNotFoundException
+ */
+ protected File initWorkingDirectory() {
+ File tmpDir = (File) getServletContext().getAttribute(
+ "javax.servlet.context.tempdir"); //$NON-NLS-1$
+ System.out.println("cache dir " + tmpDir); //$NON-NLS-1$
+ return tmpDir;
+
+
+ }
+
+ public void initResourceFactoryExtension() throws NotFoundException {
+ ServiceLoader