Update of /var/cvs/applications/scan/src/org/mmbase/module
In directory james.mmbase.org:/tmp/cvs-serv29842/src/org/mmbase/module
Modified Files:
CALC.java INFO.java MMUsers.java ParseException.java
XSLConvert.java
Log Message:
MMB-1756
See also: http://cvs.mmbase.org/viewcvs/applications/scan/src/org/mmbase/module
See also: http://www.mmbase.org/jira/browse/MMB-1756
Index: CALC.java
===================================================================
RCS file: /var/cvs/applications/scan/src/org/mmbase/module/CALC.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- CALC.java 23 Aug 2008 18:56:59 -0000 1.11
+++ CALC.java 22 Dec 2008 18:52:37 -0000 1.12
@@ -19,7 +19,7 @@
* @javadoc
* @rename Calc.java
* @author Daniel Ockeloen
- * @version $Id: CALC.java,v 1.11 2008/08/23 18:56:59 michiel Exp $
+ * @version $Id: CALC.java,v 1.12 2008/12/22 18:52:37 michiel Exp $
*/
public class CALC extends ProcessorModule {
// logging
@@ -30,7 +30,7 @@
* @javadoc
* @deprecated-now doesn't add any functionality
*/
- public Vector getList(scanpage sp,StringTagger tagger, String value)
throws ParseException {
+ @Override public List<String> getList(PageInfo sp, StringTagger tagger,
String value) {
String line = Strip.doubleQuote(value,Strip.BOTH);
StringTokenizer tok = new StringTokenizer(line,"-\n\r");
if (tok.hasMoreTokens()) {
@@ -39,22 +39,12 @@
return null;
}
- /**
- * Execute the commands provided in the form values
- * @javadoc
- * @deprecated-now doesn't add any functionality
- */
- public boolean process(scanpage sp, Hashtable cmds,Hashtable vars) {
- log.debug("CMDS="+cmds);
- log.debug("VARS="+vars);
- return false;
- }
/**
* Handle a $MOD command
* @javadoc
*/
- public String replace(scanpage sp, String cmds) {
+ @Override public String replace(PageInfo sp, String cmds) {
StringTokenizer tok = new StringTokenizer(cmds,"-\n\r");
if (tok.hasMoreTokens()) {
String cmd=tok.nextToken();
@@ -81,7 +71,7 @@
/**
* @javadoc
*/
- public String getModuleInfo() {
+ @Override public String getModuleInfo() {
return "Support routines simple calc, Daniel Ockeloen";
}
}
Index: INFO.java
===================================================================
RCS file: /var/cvs/applications/scan/src/org/mmbase/module/INFO.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- INFO.java 23 Aug 2008 18:56:59 -0000 1.55
+++ INFO.java 22 Dec 2008 18:52:37 -0000 1.56
@@ -32,7 +32,7 @@
* @author Daniel Ockeloen
* @author Eduard Witteveen
* @author Pierre van Rooden
- * @version $Id: INFO.java,v 1.55 2008/08/23 18:56:59 michiel Exp $
+ * @version $Id: INFO.java,v 1.56 2008/12/22 18:52:37 michiel Exp $
.*/
public class INFO extends ProcessorModule {
@@ -98,7 +98,8 @@
* @return a <code>Vector</code> containing the requested values.
* @throws ParseException
*/
- public Vector getList(scanpage sp,StringTagger tagger, String value)
throws ParseException {
+ @Override public List<String> getList(PageInfo sp, StringTagger tagger,
String value) {
+
String line = Strip.doubleQuote(value,Strip.BOTH);
StringTokenizer tok = new StringTokenizer(line,"-\n\r");
if (tok.hasMoreTokens()) {
@@ -118,7 +119,7 @@
* @param vars the variables to process
* @return alwyas <code>false</code>
*/
- public boolean process(scanpage sp, Hashtable cmds,Hashtable vars) {
+ @Override public boolean process(PageInfo sp, Hashtable cmds,Hashtable
vars) {
if (log.isDebugEnabled()) {
log.debug("CMDS="+cmds);
log.debug("VARS="+vars);
@@ -149,7 +150,7 @@
* @param cmds the command to process
* @return a <code>String</code> with the command's result value
*/
- public String replace(scanpage sp, String cmds) {
+ @Override public String replace(PageInfo sp, String cmds) {
StringTokenizer tok = new StringTokenizer(cmds,"-\n\r");
if (tok.hasMoreTokens()) {
String cmd=tok.nextToken();
@@ -300,7 +301,7 @@
* @param tok the StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> which is the converted value
*/
- String doEscape(scanpage sp, StringTokenizer tok) {
+ String doEscape(PageInfo sp, StringTokenizer tok) {
String result=null;
while (tok.hasMoreTokens()) {
String tmp=tok.nextToken();
@@ -321,7 +322,7 @@
* @param tok the StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> which is the converted value
*/
- String doParamEncode(scanpage sp, StringTokenizer tok) {
+ String doParamEncode(PageInfo sp, StringTokenizer tok) {
String result=null;
while (tok.hasMoreTokens()) {
String tmp=tok.nextToken();
@@ -342,7 +343,7 @@
* @param tok the StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> which is the converted value
*/
- String doParamDecode(scanpage sp, StringTokenizer tok) {
+ String doParamDecode(PageInfo sp, StringTokenizer tok) {
String result=null;
while (tok.hasMoreTokens()) {
String tmp=tok.nextToken();
@@ -363,7 +364,7 @@
* @param tok the StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> which is the converted value
*/
- String doOs(scanpage sp, StringTokenizer tok) {
+ String doOs(PageInfo sp, StringTokenizer tok) {
if (tok.hasMoreTokens()) {
String cmd=tok.nextToken();
return "Illegal OS command";
@@ -407,7 +408,7 @@
* param tok the StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> containing a random number
*/
- String doRandom(scanpage sp, StringTokenizer tok) {
+ String doRandom(PageInfo sp, StringTokenizer tok) {
int j=0;
int s=0;
int e=0;
@@ -439,7 +440,7 @@
* @param tok The StringTokenizer containing the subsequent cmd argument
tokens.
* @return a <code>String</code> containing the result
*/
- String doBrowser(scanpage sp, StringTokenizer tok) {
+ String doBrowser(PageInfo sp, StringTokenizer tok) {
if (tok.hasMoreTokens()) {
String cmd=tok.nextToken();
if (cmd.equals("OS")) {
@@ -492,11 +493,11 @@
* @author Eduard Witteveen 08-11-2000
*/
// http://uk.php.net/manual/language.variables.predefined.php <-- a few
defines from php
- String doUser(scanpage sp, StringTokenizer tok) {
+ String doUser(PageInfo sp, StringTokenizer tok) {
if (tok.hasMoreTokens()) {
String cmd=tok.nextToken();
if (cmd.equals("NAME")) return HttpAuth.getRemoteUser(sp.req);
- if (cmd.equals("SESSIONNAME")) return sp.getSessionName();
+ if (cmd.equals("SESSIONNAME")) return ((scanpage)
sp).getSessionName();
if (cmd.equals("HOSTNAME")) return sp.req.getRemoteHost();
if (cmd.equals("REQUEST_URI")) return sp.req.getRequestURI();
if (cmd.equals("SECLEVEL")) return sp.req.getAuthType();
@@ -1068,7 +1069,7 @@
* Returns a description of the module.
* @return a <code>String</code> describing the module's function.
*/
- public String getModuleInfo() {
+ @Override public String getModuleInfo() {
return "Support routines for servscan, Daniel Ockeloen";
}
@@ -1192,7 +1193,7 @@
* @return a <code>Vector</code> containing color names and RGB values
* @deprecated hereditary code. Should be dropped or adapted.
*/
- Vector doScanDate(scanpage sp,StringTagger tagger) {
+ Vector doScanDate(PageInfo sp,StringTagger tagger) {
String temp = sp.req.getHeader("Pragma");
if (temp!=null && temp.indexOf("no-cache")!=-1) {
DirCache=new Hashtable();
@@ -1339,7 +1340,7 @@
* @param tok the commands to be executed
* @return a <code>String</code> withe the value 'YES' if the check
succeeded, 'NO' if it failed.
*/
- public String doExists(scanpage sp,StringTokenizer tok) {
+ protected String doExists(PageInfo sp,StringTokenizer tok) {
String type=tok.nextToken();
String path=tok.nextToken();
boolean rtn=false;
@@ -1355,7 +1356,7 @@
path=droot+path;
// debug("INFO -> doExists full path : "+path);
} else {
- String r=sp.req_line;
+ String r= ((scanpage) sp).req_line;
int i=r.lastIndexOf('/');
path=documentroot+r.substring(0,i+1)+path;
// debug("INFO -> doExists req path : "+path);
@@ -1405,7 +1406,7 @@
* @param tok the commands to be executed
* @return Always <code>null</code>. This comamnd is executed for its side
effects, it does not return a value.
*/
- private String doMove( scanpage sp, StringTokenizer tok ) {
+ private String doMove(PageInfo sp, StringTokenizer tok ) {
String result = null;
if( tok.hasMoreTokens() ) {
@@ -1415,9 +1416,9 @@
String toDir = tok.nextToken();
moveFile( from, toDir );
} else
- log.error("doMove(): ERROR: page("+sp.getUrl()+"): no
destination specified in $MOD-INFO-MOVE-"+from+" !");
+ log.error("doMove(): ERROR: page(" + sp + "): no destination
specified in $MOD-INFO-MOVE-"+from+" !");
} else
- log.error("doMove(): ERROR: page("+sp.getUrl()+"): no source
directory given in $MOD-INFO-MOVE-.. !");
+ log.error("doMove(): ERROR: page("+ sp +"): no source directory
given in $MOD-INFO-MOVE-.. !");
return result;
}
Index: MMUsers.java
===================================================================
RCS file: /var/cvs/applications/scan/src/org/mmbase/module/MMUsers.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- MMUsers.java 1 Aug 2008 21:46:51 -0000 1.16
+++ MMUsers.java 22 Dec 2008 18:52:37 -0000 1.17
@@ -24,7 +24,7 @@
* @application SCAN
* @author Arjan Houtman
* @author Daniel Ockeloen
- * @version $Id: MMUsers.java,v 1.16 2008/08/01 21:46:51 michiel Exp $
+ * @version $Id: MMUsers.java,v 1.17 2008/12/22 18:52:37 michiel Exp $
*/
public class MMUsers extends ProcessorModule {
@@ -273,7 +273,7 @@
* <LIST GETPROPERTY PARENT=[value] FIELD=[values] PROCESSOR="MMUsers">
* </LIST>
*/
- public Vector getList(scanpage sp, StringTagger tagger, String value)
throws ParseException{
+ @Override public List<String> getList(PageInfo sp, StringTagger tagger,
String value) {
StringTokenizer tokens = new StringTokenizer (value, "-\n\r");
String tok = tokens.nextToken ();
Vector res = new Vector ();
@@ -348,7 +348,7 @@
/**
* Handle a $MOD command
*/
- public String replace (scanpage sp, String command) {
+ @Override public String replace (PageInfo sp, String command) {
StringTokenizer tokens = new StringTokenizer (command, "-\n\r");
if (tokens.hasMoreTokens ()) {
@@ -358,10 +358,10 @@
String param2 = tokens.nextToken ();
if (param2.equals ("GET")) return replaceGet(param1,
tokens);
else if (param2.equals ("PUT")) return replacePut(param1,
tokens);
- else if (param1.equals ("SWITCH")) return replaceSwitch(sp,
param2);
+ else if (param1.equals ("SWITCH")) return
replaceSwitch((scanpage) sp, param2);
else if (param1.equals ("SEARCHUSERNUMBER"))
return doSearchUserNumber(addRemainingTokens(param2,
tokens));
- else if (param1.equals ("CREATELOGIN")) return createLogin
(param2, tokens, sp);
+ else if (param1.equals ("CREATELOGIN")) return createLogin
(param2, tokens, (scanpage) sp);
// Everything else is an error:
else return error ("MMUSERS-" + param1 + " has illegal
parameter " + param2 + " following");
@@ -527,7 +527,7 @@
/**
*/
- public String getModuleInfo () {
+ @Override public String getModuleInfo () {
return "Support routines for MMUsers, by Daniel Ockeloen & Arjan
Houtman";
}
Index: ParseException.java
===================================================================
RCS file: /var/cvs/applications/scan/src/org/mmbase/module/ParseException.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- ParseException.java 1 Oct 2004 08:42:47 -0000 1.4
+++ ParseException.java 22 Dec 2008 18:52:37 -0000 1.5
@@ -16,9 +16,9 @@
*
* @application SCAN - Removing this from Core requires changes in
Module/MMObjectBuilder
* @author Wilbert Hengst
- * @version $Id: ParseException.java,v 1.4 2004/10/01 08:42:47 pierre Exp $
+ * @version $Id: ParseException.java,v 1.5 2008/12/22 18:52:37 michiel Exp $
*/
-public class ParseException extends ServletException {
+public class ParseException extends RuntimeException {
//javadoc is inherited
public ParseException() {
Index: XSLConvert.java
===================================================================
RCS file: /var/cvs/applications/scan/src/org/mmbase/module/XSLConvert.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- XSLConvert.java 26 Aug 2008 22:38:49 -0000 1.1
+++ XSLConvert.java 22 Dec 2008 18:52:37 -0000 1.2
@@ -28,7 +28,7 @@
* @application XSL or Tools
* @move org.mmbase.util.xml
* @author Case Roole, [email protected]
- * @version $Id: XSLConvert.java,v 1.1 2008/08/26 22:38:49 michiel Exp $
+ * @version $Id: XSLConvert.java,v 1.2 2008/12/22 18:52:37 michiel Exp $
*/
public class XSLConvert extends ProcessorModule {
@@ -45,22 +45,6 @@
}
/**
- * Generate a list of values from a command to the processor
- *
- * NOT IMPLEMENTED FOR XSLConvert
- */
- public Vector getList(PageInfo sp,StringTagger tagger, String value) {
- return null;
- }
-
- /**
- * Execute the commands provided in the form values
- */
- public boolean process(PageInfo sp, Hashtable cmds,Hashtable vars) {
- return false;
- }
-
- /**
* Handle a $MOD command
*
* It is called as:
@@ -69,7 +53,7 @@
* - xmlPath is the path relative to mmbase.config and,
* - xslFile is xsl file located in the subdirectory xslt of mmbase.config.
*/
- public String replace(PageInfo sp, String cmds) {
+ @Override public String replace(PageInfo sp, String cmds) {
StringTokenizer tok = new StringTokenizer(cmds,"-\n\r");
int count = tok.countTokens();
String[] argv = new String[count];
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs