зеркало из https://github.com/mozilla/pjs.git
update the web service compile & deploy script so it actually works, part of 170006
This commit is contained in:
Родитель
e241461844
Коммит
f605167fef
|
@ -35,13 +35,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/**
|
||||
* VersionCheckSoapBindingImpl.java
|
||||
*
|
||||
* This file was auto-generated from WSDL
|
||||
* by the Apache Axis WSDL2Java emitter.
|
||||
*/
|
||||
|
||||
package org.mozilla.update.extensions;
|
||||
|
||||
import java.sql.*;
|
||||
|
@ -55,16 +48,9 @@ public class VersionCheck
|
|||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
VersionCheckSoapBindingImpl impl = new VersionCheckSoapBindingImpl();
|
||||
int id = impl.getNewestExtension("{bb8ee064-ccb9-47fc-94ae-ec335af3fe2d}", "3.0", "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", "0.8.0+");
|
||||
System.out.println("result = " + impl.getProperty(id, "xpiurl"));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("e = " + e.getMessage());
|
||||
}
|
||||
VersionCheck impl = new VersionCheck();
|
||||
int id = impl.getNewestExtension("{bb8ee064-ccb9-47fc-94ae-ec335af3fe2d}", "3.0", "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}", "0.8.0+");
|
||||
System.out.println("result = " + impl.getProperty(id, "xpiurl"));
|
||||
}
|
||||
|
||||
protected Connection getConnection() throws Exception
|
||||
|
@ -73,6 +59,19 @@ public class VersionCheck
|
|||
return DriverManager.getConnection("jdbc:mysql://localhost/umo_extensions", "root", "");
|
||||
}
|
||||
|
||||
public Extension getExtension(String aExtensionGUID, String aInstalledVersion, String aTargetApp, String aTargetAppVersion)
|
||||
{
|
||||
int id = getNewestExtension(aExtensionGUID, aInstalledVersion, aTargetApp, aTargetAppVersion);
|
||||
Extension e = new Extension();
|
||||
e.row = id;
|
||||
e.id = getProperty(id, "id");
|
||||
e.version = getProperty(id, "version");
|
||||
e.name = getProperty(id, "name");
|
||||
e.xpiURL = getProperty(id, "xpiurl");
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
public String getProperty(int aRowID, String aProperty)
|
||||
{
|
||||
String result = null;
|
||||
|
@ -90,7 +89,6 @@ public class VersionCheck
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
result = e.getMessage();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
clear
|
||||
# Original script by Darin Fisher, modified to also deploy
|
||||
# by Ben Goodger
|
||||
|
||||
sAXIS_HOME=`cygpath --unix "$AXIS_HOME"`
|
||||
sCATALINA_HOME=`cygpath --unix "$CATALINA_HOME"`
|
||||
|
||||
pkg="org.mozilla"
|
||||
|
||||
|
@ -20,24 +24,29 @@ if [ "x$2" != "x" ]; then
|
|||
fi
|
||||
|
||||
pkg_dir=$(echo $pkg | sed 's/\./\//g')
|
||||
echo "pkg_dir = $AXIS_HOME/$pkg_dir"
|
||||
rm -rf "$AXIS_HOME/$pkg_dir/*"
|
||||
|
||||
#
|
||||
# remove old generated files
|
||||
#
|
||||
srcdir=$(pwd)
|
||||
cd "$sAXIS_HOME/$pkg_dir"
|
||||
rm -rf *
|
||||
cd $srcdir
|
||||
interface="$pkg_dir/$name.java"
|
||||
|
||||
srcdir=$(pwd)
|
||||
cd "$AXIS_HOME"
|
||||
cd "$sAXIS_HOME"
|
||||
|
||||
#
|
||||
# create standard interface file, and compile it.
|
||||
#
|
||||
#mkdir -p $pkg_dir || exit 1
|
||||
cp -f $srcdir/$name.java $interface
|
||||
javac $interface || exit 1
|
||||
cp -f "$srcdir"/*.java "$sAXIS_HOME/$pkg_dir"
|
||||
javac "$pkg_dir"/*.java || exit 1
|
||||
|
||||
#
|
||||
# create WSDL and supporting files from generated interface file.
|
||||
#
|
||||
java org.apache.axis.wsdl.Java2WSDL -o $pkg_dir/$name.wsdl \
|
||||
java org.apache.axis.wsdl.Java2WSDL -o "$AXIS_HOME\\$pkg_dir\\$name.wsdl" \
|
||||
-l"http://localhost:8080/axis/services/$name" -n "urn:$name" \
|
||||
-p"$pkg" "urn:$name" $pkg.$name || exit 1
|
||||
|
||||
|
@ -51,7 +60,6 @@ if [ ! -f "$name.wsdl" -o ! -f "$pkg_dir/"$name"SoapBindingImpl.java" ]; then
|
|||
echo "something went wrong!"
|
||||
exit 1
|
||||
fi
|
||||
echo "ok, now add your implementation code to $pkg_dir/$nameSoapBindingImpl.java"
|
||||
|
||||
#
|
||||
# Now compile the bindings and deploy the web service.
|
||||
|
@ -62,18 +70,20 @@ cp $srcdir/$name.java $pkg_dir/${name}SoapBindingImpl.java
|
|||
# Replace $name with $nameSoapBindingImpl in the class definition
|
||||
#
|
||||
regexp="s/$name/${name}SoapBindingImpl/g"
|
||||
echo "regexp = $regexp"
|
||||
sed -e $regexp $pkg_dir/${name}SoapBindingImpl.java > $pkg_dir/temp.java
|
||||
mv $pkg_dir/temp.java $pkg_dir/${name}SoapBindingImpl.java
|
||||
|
||||
echo "sed -e 's/public class ${name}SoapBindingImpl/public class ${name}SoapBindingImpl implements ${pkg}.${name}/g' $pkg_dir/${name}SoapBindingImpl.java > $pkg_dir/temp.java"
|
||||
sed -e 's/public class ${name}SoapBindingImpl/public class ${name}SoapBindingImpl implements ${pkg}.${name}/g' $pkg_dir/${name}SoapBindingImpl.java > $pkg_dir/temp.java
|
||||
mv $pkg_dir/temp.java $pkg_dir/${name}SoapBindingImpl.java
|
||||
regexp="s/public class ${name}SoapBindingImpl/public class ${name}SoapBindingImpl implements ${pkg}.${name}/g"
|
||||
sed -e "$regexp" $pkg_dir/${name}SoapBindingImpl.java > $pkg_dir/temp.java
|
||||
mv $pkg_dir/temp.java "$pkg_dir/${name}SoapBindingImpl.java"
|
||||
|
||||
javac $pkg_dir/*.java || exit 1
|
||||
cp $name.class ${name}SoapBindingImpl.class ${name}SoapBindingSkeleton.class \
|
||||
"$CATALINA_HOME/webapps/axis/WEB-INF/classes/$pkg_dir"
|
||||
javac "$pkg_dir\*.java" || exit 1
|
||||
cd "$sAXIS_HOME/$pkg_dir"
|
||||
cp *.class "$sCATALINA_HOME/webapps/axis/WEB-INF/classes/$pkg_dir"
|
||||
|
||||
java org.apache.axis.client.AdminClient -p 8080 $pkg_dir/deploy.wsdd
|
||||
java org.apache.axis.client.AdminClient -p 8080 deploy.wsdd
|
||||
|
||||
cd $srcdir
|
||||
|
||||
echo "$name compiled and deployed successfully, you may need to reload Axis before your service is updated."
|
||||
|
||||
cd $srcdir
|
Загрузка…
Ссылка в новой задаче