目录结构:
C:\SCRIPT
│ adintrs_oracle.sql // //oracler数据库执行文件
│ adintrs_sql.sql //sqlserver数据库执行文件
│ build.properties //ant 属性文件
│ drop.sql
│ Install.xml //ant执行脚本
│ sourcedata.xml
│ update_oracle.sql
│ update_sql.sql
│
└─jars //dbunit执行依赖目录
dbunit-2.1.jar
jtds-1.1.jar
ojdbc14.jar
adinstr_sql.sql文件内容
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADLOCATION]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADLOCATION]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADTYPE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADTYPE]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADVENDOR]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADVENDOR]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADVENDORAD]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADVENDORAD]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADVERTISE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADVERTISE]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMLOCATIONORDER]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMLOCATIONORDER]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMLOCATIONSTATUS]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMLOCATIONSTATUS]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[XWCMADMARK]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[XWCMADMARK]
CREATE TABLE [dbo].[XWCMADLOCATION] (
[ADLOCATIONID] [int] NOT NULL ,
[LOCATION] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[CHANNEL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[SIZEDESC] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[CPDAY] [int] NULL ,
[CPWEEK] [int] NULL ,
[CPMON] [int] NULL ,
[CPM] [int] NULL ,
[CPC] [int] NULL ,
[CFORALL] [int] NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL ,
[height] [int] NULL ,
[width] [int] NULL ,
[type] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[adtypeId] [int] NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMADTYPE] (
[ADTYPEID] [int] NOT NULL ,
[ADSNAME] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[ECODE] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[DESCRIPTION] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
[TYPE] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL ,
[ACTIONCODE] [ntext] COLLATE Chinese_PRC_CI_AS NULL ,
[ismultiple] [smallint] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
CREATE TABLE [dbo].[XWCMADVENDOR] (
[ADVENDORID] [int] NOT NULL ,
[ZIPCODE] [nvarchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[VENDORNAME] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[LINKMAN] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[TELEPHONE] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[CELLPHONE] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[EMAIL] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[ADDRESS] [nvarchar] (150) COLLATE Chinese_PRC_CI_AS NULL ,
[FAX] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[LINKMANPOST] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[DESCRIPTION] [nvarchar] (250) COLLATE Chinese_PRC_CI_AS NULL ,
[VENDORSITE] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMADVENDORAD] (
[ADVENDORADID] [int] NOT NULL ,
[ADVENDORID] [int] NOT NULL ,
[ADVERTISEID] [int] NOT NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMADVERTISE] (
[ADVERTISEID] [int] NOT NULL ,
[ADNAME] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[URL] [nvarchar] (500) COLLATE Chinese_PRC_CI_AS NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL ,
[ADSFILENAME] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[TEXT] [nvarchar] (200) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMLOCATIONORDER] (
[LOCATIONORDERID] [int] NOT NULL ,
[LOCATIONID] [int] NULL ,
[OCCUPYTIME] [datetime] NULL ,
[ADVENDORID] [int] NULL ,
[PRICEMODE] [int] NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL ,
[advertiseid] [int] NULL ,
[Cost] [smallmoney] NULL ,
[unitcost] [int] NULL ,
[LocationName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[VendorName] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMLOCATIONSTATUS] (
[LOCATIONSTATUSID] [int] NOT NULL ,
[LOCATIONID] [int] NOT NULL ,
[OCCUPYTIME] [datetime] NOT NULL ,
[AVAILABLE] [smallint] NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL ,
[adtypeId] [int] NULL
) ON [PRIMARY]
CREATE TABLE [dbo].[XWCMADMARK] (
[ADMARKID] [int] NOT NULL ,
[MARKNAME] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[TYPE] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[DATAFIELD] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[MARKDESC] [nvarchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[CrUser] [nvarchar] (30) COLLATE Chinese_PRC_CI_AS NULL ,
[CrTime] [datetime] NULL
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMADMARK] ADD
CONSTRAINT [PK_XWCMADMARK] PRIMARY KEY CLUSTERED
(
[ADMARKID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMADLOCATION] ADD
CONSTRAINT [PK_XWCMADLOCATION] PRIMARY KEY CLUSTERED
(
[ADLOCATIONID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMADTYPE] ADD
CONSTRAINT [DF__xwcmadtyp__ismul__5EBF139D] DEFAULT (0) FOR [ismultiple],
CONSTRAINT [PK_XWCMADTYPE] PRIMARY KEY CLUSTERED
(
[ADTYPEID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMADVENDORAD] ADD
CONSTRAINT [DF__XWCMADVEN__ADVEN__7FD5EEA5] DEFAULT (0) FOR [ADVENDORID],
CONSTRAINT [DF__XWCMADVEN__ADVER__00CA12DE] DEFAULT (0) FOR [ADVERTISEID],
CONSTRAINT [PK_XWCMADVENDORAD] PRIMARY KEY CLUSTERED
(
[ADVENDORADID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMADVERTISE] ADD
CONSTRAINT [PK_XWCMADVERTISE] PRIMARY KEY CLUSTERED
(
[ADVERTISEID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMLOCATIONORDER] ADD
CONSTRAINT [PK_XWCMLOCATIONORDER] PRIMARY KEY CLUSTERED
(
[LOCATIONORDERID]
) ON [PRIMARY]
ALTER TABLE [dbo].[XWCMLOCATIONSTATUS] ADD
CONSTRAINT [DF__xwcmlocat__adtyp__5FB337D6] DEFAULT (0) FOR [adtypeId],
CONSTRAINT [PK_XWCMLOCATIONSTATUS] PRIMARY KEY CLUSTERED
(
[LOCATIONSTATUSID]
) ON [PRIMARY]
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 26 , N'创意生活1元起' , N'http://search1.taobao.com/browse/21/t-g,ojsxgzlsozsv64dsnfrwkwzrfqytambqgaydambqlu---g,ws2nfyrafxgozone---------------y-80-grid-bid-0-all-21.htm' , N'admin' , '2005-11-09 10:12:12.127' , N'ad20051222597438759798.gif' , N'创意生活1元起' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 27 , N'马上抢购,三折优惠' , N'http://www.taobao.com/vertical/life.php?from=top' , N'admin' , '2005-11-09 10:12:57.717' , N'ad20051222600107502864.jpg' , N'马上抢购,三折优惠' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 28 , N'满就送' , N'http://www.taobao.com/vertical/life.php?from=top' , N'admin' , '2005-11-09 10:13:43.920' , N'ad20051222600482968652.gif' , N'满就送,狂减便宜狂送奖' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 30 , N'19大液晶一元换' , N'http://www.lenovo.com' , N'admin' , '2005-11-09 10:14:52.250' , N'ad20051110481429066024.gif' , N'19大液晶一元换' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 31 , N'打印机' , N'http://www.lenovo.com' , N'admin' , '2005-11-09 10:15:15.187' , N'ad20051110481264372178.gif' , N'打印机' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 32 , N'一块钱可以买到的数码产品' , N'http://www.tjbc.gov.cn/' , N'admin' , '2005-11-09 10:16:04.860' , N'ad20051222601195469555.gif' , N'一块钱可以买到的数码产品' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 33 , N'扫描仪' , N'http://www.founder.com' , N'admin' , '2005-11-09 10:16:41.750' , N'ad20051110594556092155.jpg' , N'扫描仪' )
insert xwcmadvertise(ADVERTISEID,ADNAME,URL,CrUser,CrTime,ADSFILENAME,TEXT) values( 36 , N'企业搜索' , N'http://www.baidu.com' , N'admin' , '2005-11-10 16:29:18.890' , N'ad20051110593329069541.jpg' , N'竞搜' )
insert XWCMADLOCATION(ADLOCATIONID,LOCATION,CHANNEL,SIZEDESC,CPDAY,CPWEEK,CPMON,CPM,CPC,CFORALL,CrUser,CrTime,height,width,type,adtypeId) values( 63 , N'首页上方' , N'新闻首页' , N'' , 100 , 500 , 2000 , 100 , 100 , NULL , N'admin' , '2005-11-18 10:27:55.327' , 200 , 500 , N'网幅广告' , 12 )
insert XWCMADLOCATION(ADLOCATIONID,LOCATION,CHANNEL,SIZEDESC,CPDAY,CPWEEK,CPMON,CPM,CPC,CFORALL,CrUser,CrTime,height,width,type,adtypeId) values( 64 , N'频道两边' , N'新闻评论' , N'px' , 200 , 4000 , 1000 , 200 , 300 , NULL , N'admin' , '2005-11-18 10:28:33.670' , 300 , 200 , N'网幅广告' , 10 )
insert XWCMADLOCATION(ADLOCATIONID,LOCATION,CHANNEL,SIZEDESC,CPDAY,CPWEEK,CPMON,CPM,CPC,CFORALL,CrUser,CrTime,height,width,type,adtypeId) values( 65 , N'文档正中' , N'IT新闻' , N'px' , 100 , 600 , 2500 , 100 , 100 , NULL , N'admin' , '2005-11-18 12:51:24.717' , 100 , 100 , N'弹出插播' , 14 )
insert XWCMADLOCATION(ADLOCATIONID,LOCATION,CHANNEL,SIZEDESC,CPDAY,CPWEEK,CPMON,CPM,CPC,CFORALL,CrUser,CrTime,height,width,type,adtypeId) values( 66 , N'顶部' , N'演示站点' , N'px' , 150 , 800 , 3200 , NULL , NULL , NULL , N'admin' , '2005-11-18 13:03:31.127' , 100 , 100 , N'网幅广告' , 16 )
insert XWCMADLOCATION(ADLOCATIONID,LOCATION,CHANNEL,SIZEDESC,CPDAY,CPWEEK,CPMON,CPM,CPC,CFORALL,CrUser,CrTime,height,width,type,adtypeId) values( 67 , N'频道左边' , N'新闻' , N'' , 200 , 500 , 2000 , 100 , 100 , NULL , N'admin' , '2005-11-18 13:52:28.797' , 300 , 400 , N'文本链接' , 15 )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 1 , N'${Ads_FileName}' , N'单个素材' , N'adsfilename' , N'上传文件名' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 2 , N'${Ads_Ext}' , N'单个素材' , N'adsfileext' , N'上传文件后缀名' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 3 , N'${Ads_ShowText}' , N'单个素材' , N'text' , N'页面显示文字' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 4 , N'${Ads_ActionUrl}' , N'单个素材' , N'url' , N'链接路径' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 5 , N'${Ads_Name}' , N'单个素材' , N'adname' , N'素材名称' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 6 , N'${Ads_ID}' , N'单个素材' , N'advertiseId' , N'素材ID' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 7 , N'${Array_FileName}' , N'多个素材' , N'adsfilename' , N'上传文件名数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 8 , N'${Array_Ext}' , N'多个素材' , N'adsfileext' , N'上传文件后缀名数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 9 , N'${Array_ShowText}' , N'多个素材' , N'text' , N'页面显示文字数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 10 , N'${Array_ActionUrl}' , N'多个素材' , N'url' , N'链接路径数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 11 , N'${Array_Name}' , N'多个素材' , N'adname' , N'素材名称数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 12 , N'${Array_ID}' , N'多个素材' , N'advertiseId' , N'素材ID数组' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 13 , N'${Adl_Width}' , N'广告位' , N'width' , N'广告位宽度' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 14 , N'${Adl_Height}' , N'广告位' , N'height' , N'广告位高度' , NULL , NULL )
insert XWCMADMARK(ADMARKID,MARKNAME,TYPE,DATAFIELD,MARKDESC,CrUser,CrTime) values( 15 , N'${Ads_Num}' , N'广告位' , N'AdsNum' , N'素材ID数组' , NULL , NULL )
insert xwcmadvendor(ADVENDORID,ZIPCODE,VENDORNAME,LINKMAN,TELEPHONE,CELLPHONE,EMAIL,ADDRESS,FAX,LINKMANPOST,DESCRIPTION,VENDORSITE,CrUser,CrTime) values( 1 , N'100101' , N'长江公司' , N'李先生' , N'010-64886600' , N'13810673221' , N'lilian@lenovo.com.cn' , N'海淀区' , NULL , N'经理' , N'常驻客户' , N'http://www.lenovo.com.cn/' , N'admin' , '2005-10-19 16:40:39.627' )
insert xwcmadvendor(ADVENDORID,ZIPCODE,VENDORNAME,LINKMAN,TELEPHONE,CELLPHONE,EMAIL,ADDRESS,FAX,LINKMANPOST,DESCRIPTION,VENDORSITE,CrUser,CrTime) values( 2 , N'' , N'银河搜索' , N'王先生' , N'010-64558899' , N'' , N'wangxiang@baidu.com' , N'中关村' , NULL , N'' , N'' , N'http://www.baidu.com' , N'admin' , '2005-10-26 09:46:32.297' )
insert xwcmadvendor(ADVENDORID,ZIPCODE,VENDORNAME,LINKMAN,TELEPHONE,CELLPHONE,EMAIL,ADDRESS,FAX,LINKMANPOST,DESCRIPTION,VENDORSITE,CrUser,CrTime) values( 3 , N'' , N'方企' , N'王林' , N'010-65897744' , N'' , N'wanglin@founder.com' , N'' , NULL , N'' , N'' , N'http://www.founder.com/' , N'admin' , '2005-10-26 09:46:42.407' )
insert xwcmadvendor(ADVENDORID,ZIPCODE,VENDORNAME,LINKMAN,TELEPHONE,CELLPHONE,EMAIL,ADDRESS,FAX,LINKMANPOST,DESCRIPTION,VENDORSITE,CrUser,CrTime) values( 4 , N'' , N'华园' , N'李美' , N'0712-5684714' , N'13810212444' , N'limei@udcgroup.com' , N'' , NULL , N'' , N'' , N'http://www.udcgroup.com/' , N'admin' , '2005-10-26 09:46:52.813' )
insert xwcmadvendor(ADVENDORID,ZIPCODE,VENDORNAME,LINKMAN,TELEPHONE,CELLPHONE,EMAIL,ADDRESS,FAX,LINKMANPOST,DESCRIPTION,VENDORSITE,CrUser,CrTime) values( 22 , N'100101' , N'北美集团' , N'王立' , N'01065898771' , N'' , N'bczhengfu@trs.com.cn' , N'亚运村立安路' , NULL , N'' , N'' , N'http://www.tjbc.v.cn/' , N'admin' , '2005-11-09 09:40:24.360' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 84 , 4 , 26 , N'admin' , '2005-11-09 10:12:12.140' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 85 , 4 , 27 , N'admin' , '2005-11-09 10:12:57.717' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 86 , 4 , 28 , N'admin' , '2005-11-09 10:13:43.920' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 88 , 1 , 30 , N'admin' , '2005-11-09 10:14:52.267' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 89 , 1 , 31 , N'admin' , '2005-11-09 10:15:15.203' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 90 , 22 , 32 , N'admin' , '2005-11-09 10:16:04.860' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 91 , 3 , 33 , N'admin' , '2005-11-09 10:16:41.750' )
insert XWCMADVENDORAD(ADVENDORADID,ADVENDORID,ADVERTISEID,CrUser,CrTime) values( 94 , 2 , 36 , N'admin' , '2005-11-10 16:29:18.907' )
delete from wcmschedule where schid>=0 and schid<=3
insert wcmschedule(SCHID,SCHNAME,SCHDESC,OPTYPE,OPARGS,SCHMODE,SDATE,EDATE,ETIME,PARAM,ATTRIBUTE,CRUSER,CRTIME,LASTEXETIME,LASTEXERES,LASTTIMEUSED,SENDERTYPE,SENDERID,SCHSTATUS) values( 1 , N'清除广告上传目录' , NULL , 101 , N'PATHTYPE=3&EXPIRE=1' , 1 , '2005-11-18 02:10:00.000' , '2005-11-18 23:00:00.000' , '2005-11-17 16:15:00.000' , 6 , NULL , NULL , NULL , NULL , NULL , 0 , 0 , 0 , 1 )
insert wcmschedule(SCHID,SCHNAME,SCHDESC,OPTYPE,OPARGS,SCHMODE,SDATE,EDATE,ETIME,PARAM,ATTRIBUTE,CRUSER,CRTIME,LASTEXETIME,LASTEXERES,LASTTIMEUSED,SENDERTYPE,SENDERID,SCHSTATUS) values( 2 , N'清除广告预览目录' , NULL , 101 , N'PATHTYPE=1&EXPIRE=1' , 1 , '2005-11-18 02:10:00.000' , '2005-11-18 23:00:00.000' , '2005-11-17 16:15:00.000' , 6 , NULL , NULL , NULL , NULL , NULL , 0 , 0 , 0 , 1 )
insert wcmschedule(SCHID,SCHNAME,SCHDESC,OPTYPE,OPARGS,SCHMODE,SDATE,EDATE,ETIME,PARAM,ATTRIBUTE,CRUSER,CRTIME,LASTEXETIME,LASTEXERES,LASTTIMEUSED,SENDERTYPE,SENDERID,SCHSTATUS) values( 3 , N'生成广告发布脚本' , NULL , 102 , N'http://localhost:8080/trswcm_plugins/adintrs' , 2 , '2005-11-18 00:10:00.000' , '2005-11-18 23:00:00.000' , '2005-11-18 23:59:00.000' , 360 , NULL , NULL , NULL , '2005-11-18 12:59:00.170' , NULL , 0 , 0 , 0 , 1 )
delete from wcmoper where operid=101 or operid=102
insert wcmoper(OPERID,PARAM,OPNAME,OPDESC,OPBEAN,CRUSER,CRTIME) values( 101 , N'PATHTYPE=目录类型\&EXPIRE=删除第几天前' , N'定时清理广告临时目录' , N'仅用于广告临时目录的清理' , N'com.trs.components.adintrs.helper.AdTempPathCleaner' , NULL , NULL )
insert wcmoper(OPERID,PARAM,OPNAME,OPDESC,OPBEAN,CRUSER,CRTIME) values( 102 , NULL , N'生成广告位脚本' , N'仅用于广告脚本的生成' , N'com.trs.components.adintrs.helper.AdPublishJobWorker' , NULL , NULL )
update WCMID set NEXTID=0 where TABLENAME='XWCMADVERTISE'
update WCMID set NEXTID=0 where TABLENAME='XWCMADTYPE'
update WCMID set NEXTID=0 where TABLENAME='XWCMADLOCATION'
update WCMID set NEXTID=0 where TABLENAME='XWCMADVENDOR'
update WCMID set NEXTID=0 where TABLENAME='XWCMADVENDORAD'
update WCMID set NEXTID=0 where TABLENAME='XWCMLOCATIONORDER'
update WCMID set NEXTID=0 where TABLENAME='XWCMLOCATIONSTATUS'
update WCMID set NEXTID=0 where TABLENAME='XWCMADMARK'
sourcedata.xml
<?xml version='1.0' encoding='UTF-8'?>
<dataset>
<table name="XWCMADTYPE">
<column>ADTYPEID</column>
<column>ADSNAME</column>
<column>ECODE</column>
<column>DESCRIPTION</column>
<column>TYPE</column>
<column>CrUser</column>
<column>CrTime</column>
<column>ACTIONCODE</column>
<column>ismultiple</column>
<row>
<value>5</value>
<value>弹出窗口广告</value>
<value><![CDATA[Pop-up Windows]]></value>
<value>在访问网页时,主动弹出的广告窗口</value>
<value>弹出插播</value>
<value>admin</value>
<value><![CDATA[2005-10-20 11:26:58.327]]></value>
<value><![CDATA[
window.open('${Ads_ActionUrl}','Advertise','width=${Adl_Width},height=${Adl_Height}');
]]></value>
<null/>
</row>
<row>
<value>10</value>
<value>点击消失的漂浮广告图片</value>
<value/>
<value>点击消失的漂浮广告图片</value>
<value>网幅广告</value>
<value>admin</value>
<value><![CDATA[2005-11-10 13:02:20.577]]></value>
<value><![CDATA[var Ymax=8; //MAX # OF PIXEL STEPS IN THE "X" DIRECTION
var Xmax=8; //MAX # OF PIXEL STEPS IN THE "Y" DIRECTION
var Tmax=10000; //MAX # OF MILLISECONDS BETWEEN PARAMETER CHANGES
var adsfile=${Array_FileName};
//*********DO NOT EDIT BELOW***********
var NS4 = (navigator.appName.indexOf("Netscape")>=0 && parseFloat(navigator.appVersion) >= 4 && parseFloat(navigator.appVersion) < 5)? true : false;
var IE4 = (document.all)? true : false;
var NS6 = (parseFloat(navigator.appVersion) >= 5 && navigator.appName.indexOf("Netscape")>=0 )? true: false;
var wind_w, wind_h, t='', IDs=new Array();
for(i=0; i<${Ads_Num}; i++){
t+=(NS4)?'<layer name="pic'+i+'" visibility="hide" width="10" height="10"><a href="javascript:hidebutterfly()">' : '<div id="pic'+i+'" style="position:absolute; visibility:hidden;width:10px; height:10px"><a href="javascript:hidebutterfly()">';
t+='<img src="'+adsfile[i]+'" name="p'+i+'" border="0">';
t+=(NS4)? '</a></layer>':'</a></div>';
}
document.write(t);
function moveimage(num){
if(getidleft(num)+IDs[num].W+IDs[num].Xstep >= wind_w+getscrollx())IDs[num].Xdir=false;
if(getidleft(num)-IDs[num].Xstep<=getscrollx())IDs[num].Xdir=true;
if(getidtop(num)+IDs[num].H+IDs[num].Ystep >= wind_h+getscrolly())IDs[num].Ydir=false;
if(getidtop(num)-IDs[num].Ystep<=getscrolly())IDs[num].Ydir=true;
moveidby(num, (IDs[num].Xdir)? IDs[num].Xstep : -IDs[num].Xstep , (IDs[num].Ydir)? IDs[num].Ystep: -IDs[num].Ystep);
}
function getnewprops(num){
IDs[num].Ydir=Math.floor(Math.random()*2)>0;
IDs[num].Xdir=Math.floor(Math.random()*2)>0;
IDs[num].Ystep=Math.ceil(Math.random()*Ymax);
IDs[num].Xstep=Math.ceil(Math.random()*Xmax)
setTimeout('getnewprops('+num+')', Math.floor(Math.random()*Tmax));
}
function getscrollx(){
if(NS4 || NS6)return window.pageXOffset;
if(IE4)return document.body.scrollLeft;
}
function getscrolly(){
if(NS4 || NS6)return window.pageYOffset;
if(IE4)return document.body.scrollTop;
}
function getid(name){
if(NS4)return document.layers[name];
if(IE4)return document.all[name];
if(NS6)return document.getElementById(name);
}
function moveidto(num,x,y){
if(NS4)IDs[num].moveTo(x,y);
if(IE4 || NS6){
IDs[num].style.left=x+'px';
IDs[num].style.top=y+'px';
}}
function getidleft(num){
if(NS4)return IDs[num].left;
if(IE4 || NS6)return parseInt(IDs[num].style.left);
}
function getidtop(num){
if(NS4)return IDs[num].top;
if(IE4 || NS6)return parseInt(IDs[num].style.top);
}
function moveidby(num,dx,dy){
if(NS4)IDs[num].moveBy(dx, dy);
if(IE4 || NS6){
IDs[num].style.left=(getidleft(num)+dx)+'px';
IDs[num].style.top=(getidtop(num)+dy)+'px';
}}
function getwindowwidth(){
if(NS4 || NS6)return window.innerWidth;
if(IE4)return document.body.clientWidth;
}
function getwindowheight(){
if(NS4 || NS6)return window.innerHeight;
if(IE4)return document.body.clientHeight;
}
function init(){
wind_w=getwindowwidth();
wind_h=getwindowheight();
for(i=0; i<${Ads_Num}; i++){
IDs[i]=getid('pic'+i);
if(NS4){
IDs[i].W=IDs[i].document.images["p"+i].width;
IDs[i].H=IDs[i].document.images["p"+i].height;
}
if(NS6 || IE4){
IDs[i].W=document.images["p"+i].width;
IDs[i].H=document.images["p"+i].height;
}
getnewprops(i);
moveidto(i , Math.floor(Math.random()*(wind_w-IDs[i].W)), Math.floor(Math.random()*(wind_h-IDs[i].H)));
if(NS4)IDs[i].visibility = "show";
if(IE4 || NS6)IDs[i].style.visibility = "visible";
startfly=setInterval('moveimage('+i+')',Math.floor(Math.random()*100)+100);
}}
function hidebutterfly(){
for(i=0; i<${Ads_Num}; i++){
if (IE4)
eval("document.all.pic"+i+".style.visibility='hidden'")
else if (NS6)
document.getElementById("pic"+i).style.visibility='hidden'
else if (NS4)
eval("document.pic"+i+".visibility='hide'")
clearInterval(startfly)
}
}
//more javascript from http://www.webjx.com
if (NS4||NS6||IE4){
window.onload=init;
window.onresize=function(){ wind_w=getwindowwidth(); wind_h=getwindowheight(); }
}]]></value>
<value>1</value>
</row>
<row>
<value>12</value>
<value>弹性效果的运动图片</value>
<value/>
<value>仅适用于图片类型</value>
<value>网幅广告</value>
<value>admin</value>
<value><![CDATA[2005-11-10 13:58:56.89]]></value>
<value><![CDATA[ var stringcolor="white"
var ballsrc="${Ads_FileName}" //改为自己的图片路径及名称
document.write('<STYLE>v\:* { BEHAVIOR: url(#default#VML)}</STYLE>');
if (document.all&&window.print){
document.write('<IMG id=Om style="LEFT: -10px; POSITION: absolute" src="'+ballsrc+'">')
ddx=0;ddy=0;PX=0;PY=0;xm=0;ym=0
OmW=Om.width/2;OmH=Om.height/2
}
function Ouille(){
x=Math.round(PX+=(ddx+=((xm-PX-ddx)*3)/100))
y=Math.round(PY+=(ddy+=((ym-PY-ddy)*3-300)/100))
Om.style.left=x-OmW
Om.style.top=y-OmH
elastoc.to=x+","+y
elastoc.strokecolor=stringcolor
setTimeout("Ouille()",1)
}
function momouse(){
xm=window.event.x+5
ym=window.event.y+document.body.scrollTop+15
elastoc.from=xm+","+ym
}
if(document.all&&window.print){
code="<v:line id=elastoc style='LEFT:0;POSITION:absolute;TOP:0' strokeweight='1.5pt'></v:line>"} else {
code="<v:group style='LEFT:-10;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' coordsize='21600,21600'><v:line id=elastoc style='LEFT:0;WIDTH:100pt;POSITION:absolute;TOP:0;HEIGHT:100pt' strokeweight='1.5pt'></v:line></v:group>"}
if(document.all&&window.print){
document.body.insertAdjacentHTML("afterBegin",code)
document.onmousemove=momouse
Ouille()
}]]></value>
<null/>
</row>
<row>
<value>13</value>
<value>左右浮动的广告</value>
<value/>
<value>左右浮动</value>
<value>网幅广告</value>
<value>admin</value>
<value><![CDATA[2005-11-17 13:58:51.453]]></value>
<value><![CDATA[ window.onload=sohuactivebutton;
var brOK=false;
var mie=false;
var aver=parseInt(navigator.appVersion.substring(0,1));
var aname=navigator.appName;
function checkbrOK(){
if(aname.indexOf("Internet Explorer")!=-1){
if(aver>=4) brOK=navigator.javaEnabled();
mie=true;
}
if(aname.indexOf("Netscape")!=-1){
if(aver>=4) brOK=navigator.javaEnabled();
}
}
var vmin=2;
var vmax=5;
var vr=2;
var timer1;
function Chip(chipname,width,height){
this.named=chipname;
this.vx=vmin+vmax*Math.random();
this.vy=vmin+vmax*Math.random();
this.w=width;
this.h=height;
this.xx=0;
this.yy=0;
this.timer1=null; }
function movechip(chipname){
if(brOK){
eval("chip="+chipname);
if(!mie){
pageX=window.pageXOffset;
pageW=window.innerWidth;
pageY=window.pageYOffset+300;
pageH=0; }
else{
pageX=window.document.body.scrollLeft;
pageW=window.document.body.offsetWidth;
pageY=window.document.body.scrollTop+300;
pageH=0; }
chip.xx=chip.xx+chip.vx;
chip.yy=chip.yy+chip.vy;
chip.vx+=vr*(Math.random()-0.5);
chip.vy+=vr*(Math.random()-0.5);
if(chip.vx>(vmax+vmin)) chip.vx=(vmax+vmin)*2-chip.vx;
if(chip.vx<(-vmax-vmin)) chip.vx=(-vmax-vmin)*2-chip.vx;
if(chip.vy>(vmax+vmin)) chip.vy=(vmax+vmin)*2-chip.vy;
if(chip.vy<(-vmax-vmin)) chip.vy=(-vmax-vmin)*2-chip.vy;
if(chip.xx<=pageX){
chip.xx=pageX;
chip.vx=vmin+vmax*Math.random(); }
if(chip.xx>=pageX+pageW-chip.w){
chip.xx=pageX+pageW-chip.w;
chip.vx=-vmin-vmax*Math.random(); }
if(chip.yy<=pageY){
chip.yy=pageY;
chip.vy=vmin+vmax*Math.random(); }
if(chip.yy>=pageY+pageH-chip.h){
chip.yy=pageY+pageH-chip.h;
chip.vy=-vmin-vmax*Math.random(); }
if(!mie){
eval('document.'+chip.named+'.top ='+chip.yy);
eval('document.'+chip.named+'.left='+chip.xx); }
else{
eval('document.all.'+chip.named+'.style.pixelLeft='+chip.xx);
eval('document.all.'+chip.named+'.style.pixelTop ='+chip.yy);}
chip.timer1=setTimeout("movechip('"+chip.named+"')",100);
}
}
function stopme(chipname){
if(brOK){
eval("chip="+chipname);
if(chip.timer1!=null){clearTimeout(chip.timer1)}
}
}
var sohuactivebutton;
var chip;
function sohuactivebutton(){
checkbrOK();
sohuactivebutton=new Chip("sohuactivebutton",60,80);
if(brOK){ movechip("sohuactivebutton"); }
}
document.write("<DIV id=sohuactivebutton style=\"POSITION: absolute; left: 54px; top: 192px\"><A href=${Ads_ActionUrl} target=_blank><IMG border=0 src=\"${Ads_FileName}\"></A> </DIV>");]]></value>
<null/>
</row>
<row>
<value>14</value>
<value>弹出广告特效</value>
<value/>
<value>一个IP只弹出一次</value>
<value>弹出插播</value>
<value>admin</value>
<value><![CDATA[2005-11-18 13:34:38.0]]></value>
<value><![CDATA[ var cookieString = new String(document.cookie);
var cookieHeader = 'happy_pop=' ;//更换happy_pop为任意名称
var beginPosition = cookieString.indexOf(cookieHeader);
if (beginPosition <0){
window.open("${Ads_ActionUrl}","Adveritse","top=0,left=0,width=${Adl_Width},height=${Adl_Height},toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes");
var Then = new Date();
Then.setTime(Then.getTime() + 12*60*60*1000 ); //同一ip设置过期时间,即多长间隔跳出一次
document.cookie = 'happy_pop=yes;expires='+ Then.toGMTString();//更换happy_pop和第4行一样的名称
}]]></value>
<null/>
</row>
<row>
<value>15</value>
<value>滚动公告</value>
<value/>
<value>滚动公告,文字形式</value>
<value>文本链接</value>
<value>admin</value>
<value><![CDATA[2005-11-18 13:49:59.967]]></value>
<value><![CDATA[ document.write('<marquee direction="UP" width="95%" height="98" scrolldelay="150" scrollamount="1" onMouseOver="this.stop();" onMouseOut="this.start();"><span class="jm"><font color="#000000">${Ads_ShowText}<marquee>');]]></value>
<null/>
</row>
<row>
<value>16</value>
<value>网页两边对联广告</value>
<value/>
<value>网页两边对联广告效果,可随滚动条的位置而进行上下移动</value>
<value>网幅广告</value>
<value>admin</value>
<value><![CDATA[2005-11-18 14:04:14.75]]></value>
<value><![CDATA[ //more javascript from http://www.smallrain.net
var adsfile=${Array_FileName};
function initEcAd() {
document.all.AdLayer1.style.posTop = -200;
document.all.AdLayer1.style.visibility = 'visible'
document.all.AdLayer2.style.posTop = -200;
document.all.AdLayer2.style.visibility = 'visible'
MoveLeftLayer('AdLayer1');
MoveRightLayer('AdLayer2');
}
function MoveLeftLayer(layerName) {
var x = 5;
var y = 340;
var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = parseInt(y)");
eval("document.all." + layerName + ".style.posLeft = x");
setTimeout("MoveLeftLayer('AdLayer1');", 20);
}
function MoveRightLayer(layerName) {
var x = 5;
var y = 340;
var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40;
var y = document.body.scrollTop + y - diff;
eval("document.all." + layerName + ".style.posTop = y");
eval("document.all." + layerName + ".style.posRight = x");
setTimeout("MoveRightLayer('AdLayer2');", 20);
}
var leftImage="";
for(var i=0;i<Math.round(${Ads_Num}/2);i++){
leftImage += "<img src="+adsfile[i]+">";
}
var rightImage="";
for(var i=Math.round(${Ads_Num}/2);i<${Ads_Num};i++){
rightImage += "<img src="+adsfile[i]+">";
}
document.write("<div id=AdLayer1 style='position: absolute;visibility:hidden;z-index:1'>"+leftImage+"</div>"
+"<div id=AdLayer2 style='position: absolute;visibility:hidden;z-index:1'>"+rightImage+"</div>");
initEcAd()]]></value>
<value>1</value>
</row>
<row>
<value>17</value>
<value>翻滚的图片</value>
<value/>
<value>翻滚的图片的广告代码,可以增加动感</value>
<value>网幅广告</value>
<value>admin</value>
<value><![CDATA[2005-11-18 15:01:38.36]]></value>
<value><![CDATA[ //定义图片的宽度和高度,所有的图片要有相同的尺寸;
var imgwidth=150
var imgheight=200
//下面定义了包含2个图片的数组,数组的下标从0开始,你可以增加任意的图片,按照顺序增加即可,注意相应增加数组下标。
var adsfile=${Array_FileName};
//下面定义图片的url,如果不需要url,将连接值设置为"#";
var actionurl=${Array_ActionUrl};
// 先预读图片,不要修改这里;
var imgpreload=new Array()
for (i=0;i<adsfile.length;i++) {
imgpreload[i]=new Image()
imgpreload[i].src=adsfile[i]
}
var pause=2000
//图片的显示速度,数值小速度快;
var speed=20
//下面的参数也会影响图片显示的速度,数值小速度快;代表2个图片的显示间隔。
var step=10
//不要修改下面的代码;
var i_loop=0
var i_image=0
function stretchimage() {
if (i_loop<=imgwidth) {
if (document.all) {
imgcontainer.innerHTML="<a href='"+actionurl[i_image]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+actionurl[i_image]+"' border='0'></a>"
}
i_loop=i_loop+step
var timer=setTimeout("stretchimage()",speed)
}
else {
i_loop=imgwidth
clearTimeout(timer)
imgcontainer.innerHTML="<a href='"+actionurl[i_image]+"' target='_blank'><img src='"+adsfile[i_image]+"' border='0'></a>"
var timer=setTimeout("shrinkimage()",pause)
}
}
function shrinkimage() {
if (i_loop>=0) {
if (document.all) {
imgcontainer.innerHTML="<a href='"+actionurl[i_image]+"' target='_blank'><img width='"+i_loop+"' height='"+imgheight+"' src='"+adsfile[i_image]+"' border='0'></a>"
}
i_loop=i_loop-step
var timer=setTimeout("shrinkimage()",speed)
}
else {
i_loop=0
clearTimeout(timer)
changeimage()
}
}
function changeimage() {
i_image++
if (i_image>=adsfile.length) {i_image=0}
if (document.layers) {
document.imgcontainer.document.write("<a href='"+actionurl[i_image]+"' target='_blank'><img src='"+adsfile[i_image]+"' border='0'></a>")
document.imgcontainer.document.close()
}
stretchimage()
}
//more javascript from http://www.webjx.com
var sStyle='<style> .containerstyle {position:absolute;}</style>';
document.write(sStyle);
var sShow='<span id="imgcontainer" class="containerstyle"></span>';
document.write(sShow);
stretchimage();]]></value>
<value>1</value>
</row>
</table>
</dataset>
build.properties
#import target.
sorucedata.file=${basedir}/sourcedata.xml
tablessql.src=${basedir}/adintrs_sql.sql
producesql.src=$SQL_PRODUCE$
sql.jdbcdriver=net.sourceforge.jtds.jdbc.Driver
sql.dburl=jdbc:jtds:sqlserver://localhost:1433/TRSWCM_PLUGINS
sql.dbuser=trswcm_plugins
sql.dbpwd=trsadmin
sql.schema=dbo
sql.escapePattern=[?]
ant zhixing
<?xml version="1.0" encoding="gb2312"?>
<project name="DbInstall" default="mssql" basedir=".">
<property file="build.properties"/>
<path id="dbunit.depend">
<fileset dir="${basedir}/jars">
<include name="**/*.jar" />
<include name="**/*.zip" />
</fileset>
</path>
<target name="help">
<echo message="Install database for TRSWCM5.2" />
</target>
<target name="prepare">
<taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpathref="dbunit.depend" />
</target>
<target name="oracle" depends="prepare" description="import sourcedata">
<sql driver="${sql.jdbcdriver}" url="${sql.dburl}" userid="${sql.dbuser}" password="${sql.dbpwd}" src="${producesql.src}" delimiter=","/>
<sql driver="${sql.jdbcdriver}" url="${sql.dburl}" userid="${sql.dbuser}" password="${sql.dbpwd}" src="${tablessql.src}" />
<dbunit driver="${sql.jdbcdriver}" url="${sql.dburl}"
userid="${sql.dbuser}" password="${sql.dbpwd}"
datatypeFactory="org.dbunit.ext.oracle.OracleDataTypeFactory" schema="${sql.schema}" escapePattern="${sql.escapePattern}">
<operation type="CLEAN_INSERT" src="${sorucedata.file}" format="xml" />
</dbunit>
</target>
<target name="mssql" depends="prepare" description="import sourcedata">
<sql driver="${sql.jdbcdriver}" url="${sql.dburl}" userid="${sql.dbuser}" password="${sql.dbpwd}" src="${tablessql.src}" classpathref="dbunit.depend" />
<dbunit driver="${sql.jdbcdriver}" url="${sql.dburl}"
userid="${sql.dbuser}" password="${sql.dbpwd}" schema="${sql.schema}" escapePattern="${sql.escapePattern}">
<operation type="CLEAN_INSERT" src="${sorucedata.file}" format="xml" />
</dbunit>
</target>
</project>
DatabaseTestCase类提供了两个方法来控制测试前和测试后的数据库状态:getSetUpOperation() 和 getTearDownOperation().
一种高效的实施方案就是让getSetUpOperation()方法执行REFRESH操作,通过这个操作,我们可以用种子文件中的数据去更新目标数据库里的数据。
接下来,就是getTearDownOperation(),让他去执行一个NONE操作,也就是什么也不执行
常用操作:
DatabaseOperation.CLEAN_INSERT; 先删除表中所有,再插入准备的数据
DatabaseOperation.REFRESH; 使用准备数据更新表,存在则update,不存在则insert
DatabaseOperation.DELETE; 只删除准备的数据
DatabaseOperation.NONE; 啥都不做
|