📄 circular.java
字号:
CIDirFile tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
CIDirFile wkfile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECTMP,1);
for( int ii=0;ii<bu1f.length;ii++) {
/* 夞棗斅ID庢摼 */
String gid = bu1f[ii];
wkfile.Addmod(tofile.GetMOD(gid));
}
wkfile.Save();
String path = dataDir + "user" + File.separator + sessionUID.toString() + File.separator + CICmd.CI_DIRECTMP ;
temp = new GSBinaryDownLoad(path,CICmd.CI_DIRECT_E);
temp.write(res) ;
}
}
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
break;
case CICmd.CI_P_DEL://
if( hsPara.get("__submit.x") != null ) {
bu1f = (String[])hsPara.get("cbox");
CIDirFile tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
for( int ii=0;ii<bu1f.length;ii++) {
/* 夞棗斅ID庢摼 */
String gid = bu1f[ii];
/* send僼傽僀儖偐傜嶍彍 */
tofile.Del(gid);//柧嵶嶍彍
}
tofile.Save();
}
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
break;
case CICmd.CI_IMP://
buf = (String[])hsPara.get("start.x");//栠傞
if(buf!=null) {
hash = (Hashtable)hsPara.get("tmpfile");
content = (byte[])hash.get("content");
if(content.length != 0) {
try{
String path = dataDir + "user" + File.separator + sessionUID.toString() + File.separator + CICmd.CI_DIRECTMP ;
FileOutputStream fos = new FileOutputStream(path);
BufferedOutputStream bos = new BufferedOutputStream(fos,content.length+1);
bos.write(content,0,content.length);
bos.flush();
bos.close();
}catch(FileNotFoundException e){
throw new GSException("僼傽僀儖偑尒偮偐傝傑偣傫丅",e);
}catch(IOException e){
throw new GSException("IO僄儔乕偱偡丅",e);
}
tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
CIDirFile wkfile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECTMP,0);
for( int ii=0;ii<wkfile.size();ii++) {
CIDirData wkdata = wkfile.Getmod(ii);//柧嵶撉傒崬傒
wkdata.SetId(Integer.toString(uconf.GetDirect()));
tofile.Addmod(wkdata);
uconf.SetDirect(uconf.GetDirect()+1);
}
uconf.Save();
tofile.Save();
}
}
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
break;
case CICmd.CI_SELECT:// 夞棗幰慖戰夋柺嶌惉
buf = (String[])hsPara.get("cansel.x");//庢徚
if(buf!=null) {
page = new Createcircular_new(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
}
buf = (String[])hsPara.get("select.x");//慖戰
if(buf!=null) {
dir = dataDir + "user" + File.separator + sessionUID.toString() ;
file = new File(dir + File.separator + "cirdirectwk");
if(file.exists()){
GSTool.copyFile(new File(dir + File.separator + "cirdirectwk"),new File(dir + File.separator + "cirdirect"));
}
page = new Createcircular_new(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
}
/* cirdirect僼傽僀儖峏怴 */
cifile = new CIRdirectFile(dataDir,sessionUID.toString(),2);
cidata = cifile.DataChk(sessionUID.toString());//柧嵶撉傒崬傒
buf = (String[])hsPara.get("add.x");//捛壛
if(buf!=null) {
String buf2 = (String)((String[])hsPara.get("userlist"))[0];
if(buf2!=null) {
if(!buf2.equals("-1")) {
tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
todata = tofile.GetMOD(buf2);
if ( todata.GetUserArray() != null) {
int[] alluid = todata.GetUserArray();
for(int x=0; x< alluid.length;x++) {
if ( UM.getUName(alluid[x]) != null ) {
cifile.Addmod(Integer.toString(alluid[x]),new CIRdirectData(Integer.toString(alluid[x])," "," ",UM.getUName(alluid[x])));
}
}
}
}
}
}
buf = (String[])hsPara.get("r.x");//捛壛->
if(buf!=null) {
bu1f = (String[])hsPara.get("src_right");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
if( Integer.parseInt(bu1f[i]) != -1) {
cifile.Addmod(bu1f[i],new CIRdirectData(bu1f[i]," "," ",UM.getUName(Integer.parseInt(bu1f[i]))));
}
}
}
}
buf = (String[])hsPara.get("l.x");//<-嶍彍
if(buf!=null) {
bu1f = (String[])hsPara.get("src_left");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
cifile.Deluid(bu1f[i]);
}
}
}
cifile.Save();
page = new Createcircular_select(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
case CICmd.CI_GROUP:// 夞棗愭僌儖乕僾搊榐
mode = (String)((String[])hsPara.get("mode2"))[0];
buf = (String[])hsPara.get("cansel.x");//庢徚
if(buf!=null) {
if(mode.equals("0")) {
page = new Createcircular_new(hsInitData,hsPara,intpage,UM,sessionUID.toString());
}else{
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
}
break;
}
CIDirFile wkfile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECN,0);
String gid = "-1";
CIDirData wkdata = wkfile.GetMOD(gid);
taitol = (String)((String[])hsPara.get("title"))[0];
if(taitol.length() == 0)
taitol = " ";
wkdata.SetName(taitol);
messege = (String)((String[])hsPara.get("memo"))[0];
if(messege.length() == 0)
messege = " ";
messege = cnv.ReturntoBR(messege);
wkdata.SetMemo(messege);
buf = (String[])hsPara.get("touroku.x");//搊榐
if(buf!=null) {
taitol = (String)((String[])hsPara.get("title"))[0];
if(taitol.length() == 0) {
// String url = GSTool.removeParaFormURI(req.getRequestURI()); //2001.3.1 del ookubo
String nexturl = url + "?" + CICmd.PA_CMD + "=" + CICmd.CI_GROUPS
+ "&" + CICmd.PA_MOD + "=" + (String)((String[])hsPara.get(CICmd.PA_MOD))[0]
+ "&" + CICmd.PA_MO2 + "=" + (String)((String[])hsPara.get(CICmd.PA_MO2))[0]
+ "&" + CICmd.PA_UID + "=" + (String)((String[])hsPara.get(CICmd.PA_UID))[0]
+ "&" + CICmd.PA_PAG + "=" + (String)((String[])hsPara.get(CICmd.PA_PAG))[0]
+ "&" + CICmd.PA_GROUP + "=" + (String)((String[])hsPara.get(CICmd.PA_GROUP))[0] ;
CreateErrorPage epage = new CreateErrorPage("夞棗愭僌儖乕僾柤傪擖椡偟偰偔偩偝偄丅",urlMap,nexturl);
epage.write(req,res);
return;
}
tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
wkdata.SetId(Integer.toString(uconf.GetDirect()));
tofile.Addmod(wkdata);
tofile.Save();
uconf.SetDirect(uconf.GetDirect()+1);
uconf.Save();
if(mode.equals("0")) {
page = new Createcircular_new(hsInitData,hsPara,intpage,UM,sessionUID.toString());
}else{
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
}
break;
}
buf = (String[])hsPara.get("r.x");//捛壛->
if(buf!=null) {
bu1f = (String[])hsPara.get("src_right");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
Integer wki = new Integer(bu1f[i]);
if( Integer.parseInt(bu1f[i]) != -1)
wkdata.addUser(wki);
}
}
}
buf = (String[])hsPara.get("l.x");//<-嶍彍
if(buf!=null) {
bu1f = (String[])hsPara.get("src_left");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
Integer wki = new Integer(bu1f[i]);
if( Integer.parseInt(bu1f[i]) != -1)
wkdata.delUser(wki);
}
}
}
wkfile.update(wkdata);
wkfile.Save();
case CICmd.CI_GROUPS:// 夞棗愭僌儖乕僾搊榐(昞帵峏怴梡偺儔儀儖)
page = new Createcircular_group(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
case CICmd.CI_EDITS:// 夞棗愭僌儖乕僾怴婯
tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
gid = (String)((String[])hsPara.get("gid"))[0];
CIDirData todata = tofile.GetMOD(gid);
wkfile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECW,1);
wkfile.Addmod(todata);
wkfile.Save();
page = new Createcircular_edit(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
case CICmd.CI_EDIT:// 夞棗愭僌儖乕僾曇廤
buf = (String[])hsPara.get("cansel.x");//庢徚
if(buf!=null) {
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
break;
}
wkfile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECW,0);
gid = (String)((String[])hsPara.get("gid"))[0];
wkdata = wkfile.GetMOD(gid);
taitol = (String)((String[])hsPara.get("title"))[0];
if(taitol.length() == 0)
taitol = " ";
wkdata.SetName(taitol);
messege = (String)((String[])hsPara.get("memo"))[0];
if(messege.length() == 0)
messege = " ";
messege = cnv.ReturntoBR(messege);
wkdata.SetMemo(messege);
buf = (String[])hsPara.get("edit.x");//曇廤
if(buf!=null) {
taitol = (String)((String[])hsPara.get("title"))[0];
if(taitol.length() == 0) {
// String url = GSTool.removeParaFormURI(req.getRequestURI()); //2001.3.1 del ookubo
String nexturl = url + "?" + CICmd.PA_CMD + "=" + CICmd.CI_EDIT_P
+ "&" + CICmd.PA_MOD + "=" + (String)((String[])hsPara.get(CICmd.PA_MOD))[0]
+ "&" + CICmd.PA_GID + "=" + (String)((String[])hsPara.get(CICmd.PA_GID))[0]
+ "&" + CICmd.PA_UID + "=" + (String)((String[])hsPara.get(CICmd.PA_UID))[0]
+ "&" + CICmd.PA_PAG + "=" + (String)((String[])hsPara.get(CICmd.PA_PAG))[0]
+ "&" + CICmd.PA_GROUP + "=" + (String)((String[])hsPara.get(CICmd.PA_GROUP))[0] ;
CreateErrorPage epage = new CreateErrorPage("夞棗愭僌儖乕僾柤傪擖椡偟偰偔偩偝偄丅",urlMap,nexturl);
epage.write(req,res);
return;
}
tofile = new CIDirFile(dataDir,sessionUID.toString(),CICmd.CI_DIRECT,0);
tofile.update(wkdata);
tofile.Save();
page = new Createcircular_setting(hsInitData,hsPara,intpage,sessionUID.toString(),uconf);
break;
}
buf = (String[])hsPara.get("r.x");//捛壛->
if(buf!=null) {
bu1f = (String[])hsPara.get("src_right");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
Integer wki = new Integer(bu1f[i]);
if( Integer.parseInt(bu1f[i]) != -1)
wkdata.addUser(wki);
}
}
}
buf = (String[])hsPara.get("l.x");//<-嶍彍
if(buf!=null) {
bu1f = (String[])hsPara.get("src_left");
if(bu1f!=null) {
for( int i=0;i<bu1f.length;i++) {
Integer wki = new Integer(bu1f[i]);
if( Integer.parseInt(bu1f[i]) != -1)
wkdata.delUser(wki);
}
}
}
wkfile.update(wkdata);
wkfile.Save();
case CICmd.CI_EDIT_P:// 夞棗愭僌儖乕僾曇廤(昞帵峏怴梡偺儔儀儖)
page = new Createcircular_edit(hsInitData,hsPara,intpage,UM,sessionUID.toString());
break;
}
if(page != null)
page.write(req,res);
}
//庴怣僙僉儏儕僥僀乕 2001.3.1 add ookubo
private boolean receirveCheck(String uid,HttpServletRequest req,HttpServletResponse res,String url,int cid,String dataDir)
throws GSException
{
CIReceirveFile cifile;
CIReceirveData cidata ;
CreateErrorPage page = null;
if(Integer.parseInt( uid ) < 0 )
throw new GSException("儐乕僓ID偑晄惓偱偡丅");
String nexturl = url + "?" + CICmd.PA_CMD + "=" + CICmd.CI_CIRCULAR + "&" + CICmd.PA_PAG + "=0";
cifile = new CIReceirveFile(dataDir,uid);
//
for(int i = 0; i < cifile.size(); i++) {
cidata = cifile.Getmod(i); //
if( cid == Integer.parseInt( cidata.GetCircid() ) ) {
return false;
}
}
page = new CreateErrorPage("懳徾僨乕僞偑偁傝傑偣傫丅",getMapURL(),nexturl);
try{
page.write(req,res);
}catch(GSException e){
}
return true;
}
//憲怣乛嶍彍僙僉儏儕僥僀乕 2001.3.1 add ookubo
private boolean sendCheck(String uid,HttpServletRequest req,HttpServletResponse res,String url,int cid,String dataDir)
throws GSException
{
CISendFile cifile;
CISendData cidata ;
CreateErrorPage page = null;
if(Integer.parseInt( uid ) < 0 )
throw new GSException("ID");
String nexturl = url + "?" + CICmd.PA_CMD + "=" + CICmd.CI_CIRCULAR + "&" + CICmd.PA_PAG + "=0";
cifile = new CISendFile(dataDir,uid);
//
for(int i = 0; i < cifile.size(); i++) {
cidata = cifile.Getmod(i); //
if( cid == Integer.parseInt( cidata.GetCircid() ) ) {
return false;
}
}
page = new CreateErrorPage("懳徾僨乕僞偑偁傝傑偣傫丅",getMapURL(),nexturl);
try{
page.write(req,res);
}catch(GSException e){
}
return true;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -