@echo off
if "%CLIENT_CLASSES%X" == "X" goto setenv
set JAVAC=javac
set JAVA=java
if "%1" == "-ms" set JAVAC=jvc
if "%1" == "-ms" set JAVA=jview

@echo on
@echo ============== Building Calendar JSP example ============
@echo.
%JAVAC% -d %SERVER_CLASSES% CalendarBean.java
@echo.
@echo Copying Calendar.jsp to public_html
copy Calendar.jsp %SERVER_CLASSES%\..\public_html

@echo.
@echo ============== Building SqlServlet servlet example ============
@echo.
%JAVAC% -deprecation -d %SERVLET_CLASSES% SqlServlet.java
@echo.

@echo.
@echo ============== Building booksPool JDBC example ============
@echo.
%JAVAC% -d %CLIENT_CLASSES% booksPool.java
@echo.

@echo.
@echo ============== Building Emp entity EJB example ============
@echo.
mkdir ejbtemp
mkdir ejbtemp\META-INF
copy *.xml ejbtemp\META-INF
%JAVAC% -d %CLIENT_CLASSES% Emp.java EmpBeanPK.java EmpBean.java EmpBeanHome.java
%JAVAC% -d ejbtemp Emp.java EmpBeanPK.java EmpBean.java EmpBeanHome.java
cd ejbtemp
jar cf Emp.jar examples META-INF
cd ..
del/q %WL_HOME%\myserver\Emp.jar
%JAVA% -Dweblogic.home=%WL_HOME% weblogic.ejbc ejbtemp\Emp.jar -d %WL_HOME%\myserver\Emp.jar
copy EmpQuery.jsp %SERVER_CLASSES%\..\public_html
@echo off
del/q ejbtemp\examples\intro\*.*
del/q ejbtemp\*.*
del/q ejbtemp\META-INF\*
rmdir ejbtemp\examples\intro
rmdir ejbtemp\examples
rmdir ejbtemp\META-INF
rmdir ejbtemp
@rem del Emp.jar
@echo on
@echo.
@echo ============== Building JMS example ============
@echo.
%JAVAC% -d %CLIENT_CLASSES% EmpQueueReader.java
%JAVAC% -d %SERVLET_CLASSES% EmpTrans.java

@goto end

:setenv
@echo ** Set the build environment with the setEnv.cmd script before
@echo ** you run this script.
@echo.
@echo See http://www.weblogic.com/docs51/techstart/environment.html
@echo for help.
@goto end


:end
@echo ============== Done =============== 
