Moved extensions to separate directory.

This commit is contained in:
hns 2003-06-24 14:00:55 +00:00
parent fcbfb8ace9
commit 4236304e84
7 changed files with 16 additions and 62 deletions

View file

@ -18,7 +18,7 @@
// Modified to use Helma database connections, Hannes Wallnöfer 2000-2003
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import helma.framework.core.Application;
import helma.objectmodel.db.DbSource;
@ -46,7 +46,7 @@ public class DatabaseObject {
* @param dbsource The name of the DB source
*/
DatabaseObject(DbSource dbsource, int flag) {
public DatabaseObject(DbSource dbsource, int flag) {
try {
connection = dbsource.getConnection ();
driverName = dbsource.getDriverName ();

View file

@ -15,7 +15,7 @@
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import java.io.BufferedReader;

View file

@ -14,7 +14,7 @@
* $Date$
*/
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import com.oroinc.net.ftp.*;
import java.io.*;

View file

@ -14,7 +14,7 @@
* $Date$
*/
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import helma.image.*;
import helma.util.*;

View file

@ -14,7 +14,7 @@
* $Date$
*/
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import helma.util.*;
import org.mozilla.javascript.*;

View file

@ -14,8 +14,9 @@
* $Date$
*/
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import helma.scripting.rhino.*;
import helma.framework.core.Application;
import helma.framework.core.RequestEvaluator;
import helma.objectmodel.INode;
@ -58,7 +59,7 @@ public class XmlObject {
INode node = null;
if (hopObject instanceof HopObject) {
node = ((HopObject) hopObject).node;
node = ((HopObject) hopObject).getNode();
}
// we definitly need a node
@ -95,7 +96,7 @@ public class XmlObject {
INode node = null;
if (hopObject instanceof HopObject) {
node = ((HopObject) hopObject).node;
node = ((HopObject) hopObject).getNode();
}
// we definitly need a node
@ -149,7 +150,7 @@ public class XmlObject {
INode node = null;
if (hopObject instanceof HopObject) {
node = ((HopObject) hopObject).node;
node = ((HopObject) hopObject).getNode();
}
if (node == null) {
@ -202,7 +203,7 @@ public class XmlObject {
INode node = null;
if (hopObject instanceof HopObject) {
node = ((HopObject) hopObject).node;
node = ((HopObject) hopObject).getNode();
}
if (node == null) {
@ -223,52 +224,4 @@ public class XmlObject {
}
}
/* class XmlGet extends BuiltinFunctionObject {
XmlGet(String name, Evaluator evaluator, FunctionPrototype fp) {
super(fp, evaluator, name, 1);
}
public ESValue callFunction(ESObject thisObject, ESValue[] arguments) throws EcmaScriptException {
if ( arguments==null || arguments.length==0 )
throw new EcmaScriptException("Xml.get() needs a location as an argument");
try {
XmlConverter converter;
if ( arguments.length>1 ) {
converter = new XmlConverter (arguments[1].toString());
} else {
converter = new XmlConverter ();
}
INode node = new helma.objectmodel.db.Node ( (String)null, (String)null, this.evaluator.engine.getApplication().getWrappedNodeManager() );
INode result = converter.convert (arguments[0].toString(),node);
return this.evaluator.engine.getNodeWrapper(result);
} catch ( NoClassDefFoundError e ) {
throw new EcmaScriptException("Can't load dom-capable xml parser.");
} catch ( RuntimeException f ) {
throw new EcmaScriptException(f.toString());
}
}
}
class XmlGetFromString extends BuiltinFunctionObject {
XmlGetFromString(String name, Evaluator evaluator, FunctionPrototype fp) {
super(fp, evaluator, name, 1);
}
public ESValue callFunction(ESObject thisObject, ESValue[] arguments) throws EcmaScriptException {
if ( arguments==null || arguments.length==0 )
throw new EcmaScriptException("Xml.getFromString() needs an XML string as parameter");
try {
XmlConverter converter;
if ( arguments.length>1 ) {
converter = new XmlConverter (arguments[1].toString());
} else {
converter = new XmlConverter ();
}
INode node = new helma.objectmodel.db.Node ( (String)null, (String)null, this.evaluator.engine.getApplication().getWrappedNodeManager() );
INode result = converter.convertFromString (arguments[0].toString(),node);
return this.evaluator.engine.getNodeWrapper(result);
} catch ( NoClassDefFoundError e ) {
throw new EcmaScriptException("Can't load dom-capable xml parser.");
} catch ( RuntimeException f ) {
throw new EcmaScriptException(f.toString());
}
}
} */
}

View file

@ -14,8 +14,9 @@
* $Date$
*/
package helma.scripting.rhino;
package helma.scripting.rhino.extensions;
import helma.scripting.rhino.*;
import org.mozilla.javascript.*;
import org.apache.xmlrpc.*;
import java.io.*;
@ -108,11 +109,11 @@ public class XmlRpcObject extends BaseFunction {
}
RhinoEngine engine = (RhinoEngine) cx.getThreadLocal("engine");
RhinoCore c = engine.core;
RhinoCore c = engine.getCore();
Scriptable retval = null;
try {
retval = Context.getCurrentContext().newObject(c.global);
retval = Context.getCurrentContext().newObject(c.getScope());
XmlRpcClient client = new XmlRpcClient(url);
// long now = System.currentTimeMillis ();