Changeset 3006 for branches/webservices


Ignore:
Timestamp:
Dec 7, 2006, 10:47:41 AM (16 years ago)
Author:
Nicklas Nordborg
Message:

First go at a webservices framework.

Location:
branches/webservices
Files:
58 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/webservices/build.xml

    r2994 r3006  
    4242    jobagent:     Build jobagent for local use
    4343    migrate:      Build migration tool for local use
     44    webservices:  Build webservices for local use
    4445    test:         Build test programs
    4546    doc:          Build documentation for local use
     
    5455  <property name="base.majorversion" value="2" />
    5556  <property name="base.minorversion" value="2" />
    56   <property name="base.maintenanceversion" value="0pre" />
     57  <property name="base.maintenanceversion" value="0ws" />
    5758  <property name="base.version"
    5859    value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" />
     
    7778    </fileset>
    7879  </path>
    79 
     80   
    8081  <!-- pattern for configuration files use by copy.config -->
    8182  <patternset id="config.files">
     
    120121      <fileset dir="www/WEB-INF/lib" defaultexcludes="no" />
    121122      <fileset dir="www/WEB-INF/classes" defaultexcludes="no" />
     123      <fileset dir="www/WEB-INF/conf" defaultexcludes="no" />
     124      <fileset dir="www/WEB-INF/services" defaultexcludes="no" />
    122125      <fileset dir="www/WEB-INF" includes="web.xml" defaultexcludes="no" />
    123126      <fileset dir="doc/api" defaultexcludes="no" />
     
    128131  <target
    129132    name="dist"
    130     depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,installprg.jar,
     133    depends="clean,dist.init,core.jar,coreplugins.jar,web.jar,webservices.aar,installprg.jar,
    131134      jobagent.jar,migrate.jar,copy.config,copy.jar,doc,doc.dist"
    132135    description="Create everything needed for distribution"
    133136    >
    134     <copy file="${config.dist}/web.xml" todir="${config}/.." description="Default web.xml" />
     137    <copy file="${config.dist}/web.xml" todir="${webinf}" description="Default web.xml" />
    135138    <copy todir="${dist}/www" description="JSP files, etc.">
    136139      <fileset dir="www" />
     
    164167  <target
    165168    name="dev"
    166     depends="dev.init,core,coreplugins,web,installprg,jobagent,migrate,test"
     169    depends="dev.init,core,coreplugins,web,webservices,installprg,jobagent,migrate,test"
    167170    description="Create a runnable local installation"
    168171  />
     
    214217 
    215218  <target
     219    name="webservices"
     220    depends="web,webservices.aar"
     221    description="Build webservices for local use"
     222  />
     223 
     224  <target
    216225    name="installprg"
    217226    depends="web,installprg.jar"
     
    251260    >
    252261    <property name="isDist" value="1" />
    253     <property name="jar" location="${dist}/www/WEB-INF/lib" />
    254     <property name="config" location="${dist}/www/WEB-INF/classes" />
     262    <property name="webinf" location="${dist}/www/WEB-INF" />
     263    <property name="jar" location="${webinf}/lib" />
     264    <property name="config" location="${webinf}/classes" />
    255265    <property name="bin" location="${dist}/bin" />
    256266    <property name="doc" location="${dist}/doc" />
     
    270280    >
    271281    <property name="isDev" value="1" />
    272     <property name="jar" location="www/WEB-INF/lib" />
    273     <property name="config" location="www/WEB-INF/classes" />
     282    <property name="webinf" location="www/WEB-INF" />
     283    <property name="jar" location="${webinf}/lib" />
     284    <property name="config" location="${webinf}/classes" />
    274285    <property name="bin" location="bin" />
    275286    <property name="doc" location="doc" />
     
    296307    description="Copies configuration files to the appropriate folder"
    297308    >
     309    <mkdir dir="${webinf}/conf" />
     310    <move file="${config}/axis2.xml" todir="${webinf}/conf" />
    298311  </target>
    299312   
     
    307320      </fileset>
    308321    </copy>
    309     <copy todir="${config}/.." description="Default web.xml">
     322    <copy todir="${webinf}" description="Default web.xml">
    310323      <fileset dir="${config.dist}">
    311324        <include name="web.xml" />
    312         <present present="srconly" targetdir="${config}/.." />
     325        <present present="srconly" targetdir="${webinf}" />
    313326      </fileset>
    314327    </copy>
     
    325338      </fileset>
    326339    </copy>
    327     <copy todir="${config}/.."  description="Local web.xml">
     340    <copy todir="${webinf}"  description="Local web.xml">
    328341      <fileset dir="${config.local}">
    329342        <include name="web.xml" />
     
    338351    <copy todir="${jar}" description="3rd-party JAR files">
    339352      <fileset dir="${lib}/dist">
     353        <include name="**/*" />
     354      </fileset>
     355      <fileset dir="${lib}/webservices">
    340356        <include name="**/*" />
    341357      </fileset>
     
    603619  <target
    604620    name="test.init"
    605     depends="core.init,coreplugins.init,jobagent.init"
     621    depends="core.init,coreplugins.init,jobagent.init,webservices.init"
    606622    >
    607623    <property name="test.src" location="${src}/test"
     
    610626      description="Location of compiled files" />
    611627    <path id="test.classpath" description="Class path for compiling">
    612       <path refid="core.classpath"/>
     628      <path refid="webservices.classpath"/>
    613629      <pathelement location="${core.build}" />
    614630      <pathelement location="${coreplugins.build}" />
    615631      <pathelement location="${jobagent.build}" />
     632      <pathelement location="${webservices.build}" />
    616633    </path>
    617634  </target>
     
    619636  <target
    620637    name="test.compile"
    621     depends="test.init,core.compile,coreplugins.compile,jobagent.compile"
     638    depends="test.init,core.compile,coreplugins.compile,jobagent.compile,webservices.compile"
    622639    description="Compile the test programs"
    623640    >
     
    764781      >
    765782    </javac>
     783  </target>
     784 
     785  <!-- webservices targets -->
     786  <target
     787    name="webservices.init"
     788    depends="core.init"
     789    >
     790    <property name="webservices.src" location="${src}/webservices"
     791      description="Location of source files" />
     792    <property name="webservices.build" location="${build}/webservices"
     793      description="Location of compiled files" />
     794    <path id="webservices.classpath" description="Class path for compiling webservices">
     795      <path refid="core.classpath"/>
     796      <pathelement location="${core.build}"/>
     797      <fileset dir="${lib}/webservices">
     798        <include name="**/*.jar"/>
     799      </fileset>
     800    </path>
     801  </target>
     802
     803  <target
     804    name="webservices.compile"
     805    depends="webservices.init,core.compile"
     806    description="Compile the core web services"
     807    >
     808    <mkdir dir="${webservices.build}" />
     809    <javac
     810      destdir="${webservices.build}"
     811      classpathref="webservices.classpath"
     812      encoding="ISO-8859-1"
     813      debug="true"
     814      deprecation="true"
     815      >
     816      <src path="${webservices.src}/server" />
     817      <src path="${webservices.src}/client/java" />
     818      <compilerarg value="${javac.arg}" />
     819    </javac>
     820    <copy todir="${webservices.build}"
     821      description="Resource files needed by the webservices; excludes documentation and source files"
     822      includeEmptyDirs="false"
     823      >
     824      <fileset dir="${webservices.src}/server">
     825        <include name="**/*" />
     826        <exclude name="**/*.java" />
     827        <exclude name="**/doc-files/" />
     828        <exclude name="**/package.html" />
     829      </fileset>
     830    </copy>
     831  </target>
     832 
     833  <target
     834    name="webservices.aar"
     835    depends="webservices.compile"
     836    description="Create the core webservices aar file: core.aar"
     837    >
     838    <mkdir dir="${webinf}/services" />
     839    <jar
     840      basedir="${webservices.build}"
     841      jarfile="${webinf}/services/core.aar"
     842    />
    766843  </target>
    767844 
  • branches/webservices/config/dist/web.xml

    r2994 r3006  
    127127  </servlet-mapping>
    128128
     129  <!-- Axis2 servlets for web services -->
     130  <servlet>
     131    <servlet-name>AxisServlet</servlet-name>
     132    <display-name>Apache-Axis Servlet</display-name>
     133    <servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
     134    <load-on-startup>1</load-on-startup>
     135  </servlet>
     136  <servlet>
     137    <servlet-name>AxisRESTServlet</servlet-name>
     138    <display-name>Apache-Axis Servlet (REST)</display-name>
     139    <servlet-class>org.apache.axis2.transport.http.AxisRESTServlet</servlet-class>
     140  </servlet>
     141  <servlet-mapping>
     142    <servlet-name>AxisRESTServlet</servlet-name>
     143    <url-pattern>/rest/*</url-pattern>
     144  </servlet-mapping>
     145  <servlet-mapping>
     146    <servlet-name>AxisServlet</servlet-name>
     147    <url-pattern>/services/*</url-pattern>
     148  </servlet-mapping>
    129149 
    130150  <!-- The CompileAll servlet used to compile all JSP pages -->
  • branches/webservices/src/core/net/sf/basedb/core/Config.java

    r2992 r3006  
    9494  public static String getString(String key)
    9595  {
    96     assert isInitialised : "Config has not been initialised";
     96    if (!isInitialised) init();
    9797    return getString(key, null);
    9898  }
     
    107107  public static String getString(String key, String defaultValue)
    108108  {
    109     assert isInitialised : "Config has not been initialised";
     109    if (!isInitialised) init();
    110110    String value = config.getProperty(key, defaultValue);
    111111    if (value != null) value = value.trim();
     
    121121  public static int getInt(String key)
    122122  {
    123     assert isInitialised : "Config has not been initialised";
     123    if (!isInitialised) init();
    124124    return getInt(key, 0);
    125125  }
     
    135135  public static int getInt(String key, int defaultValue)
    136136  {
    137     assert isInitialised : "Config has not been initialised";
     137    if (!isInitialised) init();
    138138    int result = defaultValue;
    139139    String setting = config.getProperty(key);
     
    160160  public static boolean getBoolean(String key)
    161161  {
    162     assert isInitialised : "Config has not been initialised";
     162    if (!isInitialised) init();
    163163    String setting = config.getProperty(key);
    164164    return (setting == null
     
    179179  public static String getCharset()
    180180  {
     181    if (!isInitialised) init();
    181182    return config.getProperty("defaultCharset", "ISO-8859-1");
    182183  }
  • branches/webservices/src/test/TestUtil.java

    r2634 r3006  
    137137  }
    138138
     139  public static String getClient()
     140  {
     141    return client;
     142  }
     143 
    139144  public static void begin()
    140145  {
  • branches/webservices/src/test/set_classpath.bat

    r2967 r3006  
    7878SET CP=%CP%;../../lib/dist/jfreechart-1.0.3.jar
    7979SET CP=%CP%;../../lib/dist/jcommon-1.0.6.jar
     80
     81# Axis
     82SET CP=%CP%;../../lib/webservices/axis2-kernel-1.1.jar
     83SET CP=%CP%;../../lib/webservices/axis2-adb-1.1.jar
     84SET CP=%CP%;../../lib/webservices/axiom-api-1.2.jar
     85SET CP=%CP%;../../lib/webservices/axiom-dom-1.2.jar
     86SET CP=%CP%;../../lib/webservices/axiom-impl-1.2.jar
     87SET CP=%CP%;../../lib/webservices/stax-api-1.0.1.jar
     88SET CP=%CP%;../../lib/webservices/wstx-asl-3.0.1.jar
     89SET CP=%CP%;../../lib/webservices/wsdl4j-1.6.1.jar
     90SET CP=%CP%;../../lib/webservices/XmlSchema-1.2.jar
     91SET CP=%CP%;../../lib/webservices/mail-1.4.jar
     92SET CP=%CP%;../../lib/webservices/commons-httpclient-3.0.1.jar
     93SET CP=%CP%;../../lib/webservices/commons-codec-1.3.jar
     94SET CP=%CP%;../../lib/webservices/activation-1.1.jar
     95
  • branches/webservices/src/test/set_classpath.sh

    r2967 r3006  
    2222
    2323LIB=../../lib/dist
     24WS_LIB=../../lib/webservices
    2425
    2526# Set up the classpath
     
    3637CP=$CP:../plugins/core
    3738CP=$CP:../clients/jobagent
     39CP=$CP:../webservices
    3840
    3941# Hibernate
     
    8082CP=$CP:$LIB/jcommon-1.0.6.jar
    8183
     84# Axis
     85CP=$CP:$WS_LIB/axis2-kernel-1.1.jar
     86CP=$CP:$WS_LIB/axis2-adb-1.1.jar
     87CP=$CP:$WS_LIB/axiom-api-1.2.jar
     88CP=$CP:$WS_LIB/axiom-dom-1.2.jar
     89CP=$CP:$WS_LIB/axiom-impl-1.2.jar
     90CP=$CP:$WS_LIB/stax-api-1.0.1.jar
     91CP=$CP:$WS_LIB/wstx-asl-3.0.1.jar
     92CP=$CP:$WS_LIB/wsdl4j-1.6.1.jar
     93CP=$CP:$WS_LIB/XmlSchema-1.2.jar
     94CP=$CP:$WS_LIB/mail-1.4.jar
     95CP=$CP:$WS_LIB/commons-httpclient-3.0.1.jar
     96CP=$CP:$WS_LIB/commons-codec-1.3.jar
     97CP=$CP:$WS_LIB/activation-1.1.jar
Note: See TracChangeset for help on using the changeset viewer.