📄 bulletin.java
字号:
int intpage = Integer.parseInt( strpage );
if(cmd == BLCmd.BL_D_TEMP) {
String path = dataDir + "group" + File.separator + selectgrp + File.separator + (String)((String[])hsPara.get(BLCmd.PA_BID))[0] + "b" ;
bldata = new BLDataFile();
bldata.Getb(dataDir,(String)((String[])hsPara.get(BLCmd.PA_GID))[0],(String)((String[])hsPara.get(BLCmd.PA_BID))[0]) ;
temp = new GSBinaryDownLoad(path,bldata.getTmpfile());
//temp.setContentType(bldata.getTmptype()) ;
temp.write(res) ;
return;
}
switch(cmd){
case BLCmd.BL_BULLITEN:// 宖帵斅堦棗
page = new Createbulletin_body(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_BULL:// 宖帵斅堦棗
buf = (String[])hsPara.get("parsonal.x");
if(buf!=null) {
page = new Createbulletin_setting(hsInitData,hsPara,uconf,intpage,sessionUID.intValue(),UM,dataDir);//屄恖愝掕
break;
}
buf = (String[])hsPara.get("group.x");
if(buf!=null) {
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
buf = (String[])hsPara.get("new.x");
if(buf!=null) {
if( Integer.parseInt( selectgrp ) == 0 ) {
grpname = "嫟捠";
}else{
grpname = UM.getGName(Integer.parseInt( selectgrp ));
}
page = new Createbulletin_new(hsInitData,hsPara,intpage,grpname);
break;
}
buf = (String[])hsPara.get("up.x");
if(buf!=null) {
intpage++;
}
buf = (String[])hsPara.get("down.x");
if(buf!=null) {
intpage--;
}
page = new Createbulletin_body(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_PERSONAL:// 屄恖愝掕 2002.04.09 update by a.matsubara
if( (hsPara.get(BLCmd.PA_LTORX)!=null) || (hsPara.get(BLCmd.PA_RTOLX)!=null) ){
page = new Createbulletin_setting(hsInitData,hsPara,uconf,intpage,sessionUID.intValue(),UM,dataDir);//屄恖愝掕
break;
}
buf = (String[])hsPara.get("set.x");
if(buf!=null) {
// 堦帪僼傽僀儖偺撪梕傪僐僺乕
File src = new File(dataDir + GSFilename.GS_DIR_USER + File.separator + sessionUID.intValue() + File.separator + BLCmd.TEMPFILENAME);
File dst = new File(dataDir + GSFilename.GS_DIR_USER + File.separator + sessionUID.intValue() + File.separator + BLCmd.USERFILENAME);
GSTool.copyFile(src,dst);
// 曄峏抣傪忋彂偒
uconf = new BLUserConfFile(dataDir,sessionUID.toString());
uconf.Load();
String display = (String)((String[])hsPara.get(BLCmd.PA_DSPLAY))[0];
String dispcnt = (String)((String[])hsPara.get(BLCmd.PA_DSPCNT))[0];
uconf.SetDisplay(display);
uconf.SetDispcnt(dispcnt);
uconf.Save();
}
page = new Createbulletin_body(hsInitData,hsPara,blindex,0,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_ADMIN:// 娗棟幰梡 2002.04.26 update(delete) and add(alsel,unsel) by a.matsubara
buf = (String[])hsPara.get("return.x");
if(buf!=null) {
page = new Createbulletin_body(hsInitData,hsPara,blindex,Integer.parseInt((String)((String[])hsPara.get(BLCmd.PA_PAG))[0]),uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
buf = (String[])hsPara.get("alsel.x");
if(buf!=null) {
hsPara.remove("cbox");
String[] cboxs = new String[blindex.size()];
for(int i=0; i<blindex.size(); i++) {
BLIndexData mod = blindex.Getmod(i);
cboxs[i] = mod.GetBullid();
}
hsPara.put("cbox",cboxs);
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
buf = (String[])hsPara.get("unsel.x");
if(buf!=null) {
}
buf = (String[])hsPara.get("delete.x");
if(buf!=null) {
String[] buf1 = (String[])hsPara.get("cbox");
if(buf1!=null) {
page = new Createbulletin_delList(hsInitData,buf1,blindex,Integer.parseInt((String)((String[])hsPara.get(BLCmd.PA_PAG))[0]),selectgrp);
break;
}
}
buf = (String[])hsPara.get("up.x");
if(buf!=null) {
intpage++;
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
buf = (String[])hsPara.get("down.x");
if(buf!=null) {
intpage--;
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
// 昞帵僌儖乕僾曄峏帪偵CBOX抣傪夝曻
hsPara.remove("cbox");
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_A_DEL_OK:// 娗棟幰梡 嶍彍 2002.04.30 add(delete,cancel) and delete(submit) by a.matsubara
if(delCheck(sessionUID.intValue(),req,res,url,Integer.parseInt( selectgrp ),UM)) return; //2001.2.28 add ookubo
int nextp = 0;
buf = (String[])hsPara.get("delete.x");
if(buf!=null) {
String[] buf1 = (String[])hsPara.get("cbox");
for(int i=0; i<buf1.length; i++){
blindex.Delbullid(buf1[i]);
}
blindex.Save();
hsPara.remove("cbox");
}
buf = (String[])hsPara.get("cancel.x");
if(buf!=null) {
nextp = Integer.parseInt((String)((String[])hsPara.get(BLCmd.PA_PAG))[0]);
}
//if( hsPara.get("__submit.x") != null ) {
// String[] bu1f = (String[])hsPara.get("cbox");
// for( int i=0;i<bu1f.length;i++) {
// blindex.Delbullid(bu1f[i]);
// }
// blindex.Save();
//}
page = new Createbulletin_body_ad(hsInitData,hsPara,blindex,nextp,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_NEW_P:// 怴婯嶌惉
if( Integer.parseInt( selectgrp ) == 0 ) {
grpname = "嫟捠";
}else{
grpname = UM.getGName(Integer.parseInt( selectgrp ));
}
page = new Createbulletin_new(hsInitData,hsPara,intpage,grpname);
break;
case BLCmd.BL_NEW:// 怴婯嶌惉
if(newCheck(sessionUID.intValue(),req,res,url,Integer.parseInt( selectgrp ),UM)) return; //2001.2.28 add ookubo
buf = (String[])hsPara.get("toukou.x"); //搳峞
if(buf!=null) {
bldata = new BLDataFile((String)hsInitData.get(BLCmd.BL_DIR),selectgrp,conf.GetStrBullMax());
entuserid = sessionUID.toString();
taitol = (String)((String[])hsPara.get("taitol"))[0];
if(taitol.length() == 0) {
// String url = GSTool.removeParaFormURI(req.getRequestURI()); // 2001.2.28 del ookubo
String nexturl = url + "?" + BLCmd.PA_CMD + "=" + BLCmd.BL_NEW_P
+ "&" + BLCmd.PA_GID + "=" + (String)((String[])hsPara.get(BLCmd.PA_GID))[0]
+ "&" + BLCmd.PA_PAG + "=" + (String)((String[])hsPara.get(BLCmd.PA_PAG))[0] ;
CreateErrorPage epage = new CreateErrorPage("僞僀僩儖傪擖椡偟偰偔偩偝偄丅",urlMap,nexturl);
epage.write(req,res);
return;
}
taitol = cnv.ReturntoBR(taitol);
messege = (String)((String[])hsPara.get("messege"))[0];
if(messege.length() == 0)
messege = " ";
messege = cnv.ReturntoBR(cnv.safetyHTML(messege));
/* 2002.04.04 update by a.matsubara ---------------------------------------------- */
byte[] content = new byte[0];
try{
Hashtable hash = (Hashtable)hsPara.get("tmpfile");
tmpfile = (String)hash.get("filename");
tmptype = (String)hash.get("content-type");
content = (byte[])hash.get("content");
if(tmpfile.length() == 0) {
tmpfile = " ";
tmptype = " ";
}else{
tmpfile = GSTool.Lastname(tmpfile);
}
} catch( ClassCastException e) {
tmpfile = " ";
tmptype = " ";
}
/* ------------------------------------------------------------------------------- */
String yy = (String)((String[])hsPara.get("yy"))[0];
cal.ResetTime();
timestamp = cal.getstrYear() + cal.getstrMonth() + cal.getstrDate() + cal.getstrHour() + cal.getstrMinute() + cal.getstrSecond();
int mm = cal.getMonth();
int dd = cal.getDate();
switch(Integer.parseInt(yy)){
case 0:
dd = dd + 7;
break;
case 1:
dd = dd + 14;
break;
case 2:
dd = dd + 21;
break;
case 3:
mm = mm + 1;
break;
case 4:
mm = mm + 2;
break;
case 5:
mm = mm + 3;
break;
}
if(Integer.parseInt(yy) == 6 ){
limit = "-1";
}else{
cal.setYMD(cal.getYear() , mm , dd);
limit = cal.getstrYear() + cal.getstrMonth() + cal.getstrDate() + cal.getstrHour() + cal.getstrMinute() + cal.getstrSecond();
}
if(content.length == 0) {
tmpfile = " ";
tmptype = " ";
}
bldata.BLData(entuserid,sessionUNAME,taitol,messege,limit,timestamp,tmpfile,tmptype);
bldata.Save();
if(content.length != 0) {
bldata.setContent(content);
}
blindex.Addmod(0,new BLIndexData(conf.GetStrBullMax(),"0",conf.GetStrBullMax(),limit));
blindex.Save();
conf.SetBulletinMax(conf.GetBulletinMax()+1);
conf.Save();
}
page = new Createbulletin_body(hsInitData,hsPara,blindex,0,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
case BLCmd.BL_OPINION:// 堄尒嶌惉
page = new Createbulletin_text(hsInitData,hsPara,intpage,sessionUID.intValue());
break;
case BLCmd.BL_O_SET:// 堄尒嶌惉 搳峞 2002.04.04 update by a.matsubara
if(newCheck(sessionUID.intValue(),req,res,url,Integer.parseInt( selectgrp ),UM)) return; //2001.2.28 add ookubo
buf = (String[])hsPara.get("hensyu.x");
if(buf!=null) {
page = new Createbulletin_edit(hsInitData,hsPara,intpage);
break;
}
buf = (String[])hsPara.get("cansel.x");
if(buf!=null) {
page = new Createbulletin_body(hsInitData,hsPara,blindex,intpage,uconf.GetDispcntMax(),sessionUID.intValue(),UM);
break;
}
bldata = new BLDataFile((String)hsInitData.get(BLCmd.BL_DIR),selectgrp,conf.GetStrBullMax());
entuserid = sessionUID.toString();
taitol = (String)((String[])hsPara.get("taitol"))[0];
if(taitol.length() == 0) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -