vgritsenko 02/02/20 18:44:23
Modified: src/java/org/apache/cocoon/components/language/markup/xsp
JSGenerator.java
Log:
Implement dependency checking for Javascript XSP pages
Revision Changes Path
1.4 +14 -9
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java
Index: JSGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/JSGenerator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JSGenerator.java 11 Feb 2002 04:36:38 -0000 1.3
+++ JSGenerator.java 21 Feb 2002 02:44:23 -0000 1.4
@@ -96,7 +96,7 @@
* written in Javascript language
*
* @author <a href="mailto:[EMAIL PROTECTED]">Vadim Gritsenko</a>
- * @version CVS $Id: JSGenerator.java,v 1.3 2002/02/11 04:36:38 vgritsenko Exp $
+ * @version CVS $Id: JSGenerator.java,v 1.4 2002/02/21 02:44:23 vgritsenko Exp $
*/
public class JSGenerator extends XSPGenerator
implements Configurable, Initializable {
@@ -114,6 +114,12 @@
public void configure(Configuration configuration) throws
ConfigurationException {
this.file = new File(configuration.getChild("file").getValue());
+
+ Configuration[] dependencies = configuration.getChildren("dependency");
+ this.dependencies = new File[dependencies.length];
+ for (int i = 0; i < dependencies.length; i ++) {
+ this.dependencies[i] = new File(dependencies[i].getValue());
+ }
}
/**
@@ -127,12 +133,11 @@
return true;
}
- // FIXME
-// for (int i = 0; i < dependencies.length; i++) {
-// if (dateCreated < dependencies[i].lastModified()) {
-// return true;
-// }
-// }
+ for (int i = 0; i < dependencies.length; i++) {
+ if (this.file.lastModified() < dependencies[i].lastModified()) {
+ return true;
+ }
+ }
return false;
}
@@ -257,8 +262,8 @@
*
* @param comment The comment data
*/
- public void jsComment(String data) throws SAXException {
- this.lexicalHandler.comment(data.toCharArray(), 0, data.length());
+ public void jsComment(String comment) throws SAXException {
+ this.lexicalHandler.comment(comment.toCharArray(), 0, comment.length());
}
// XSPObjectHelper
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]