乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Java代理程序?qū)崿F(xiàn)web方式管理郵件組成員

       集微筆記 2014-04-25

      Java代理程序?qū)崿F(xiàn)web方式管理郵件組成員

      說(shuō)到j(luò)ava大家并不陌生,java對(duì)于開發(fā)人員來(lái)說(shuō)基礎(chǔ)最早的開發(fā)語(yǔ)言之一,也是應(yīng)用最多的,同時(shí)我們也知道,domino跟java是完美結(jié)合,domino可以根據(jù)自己的需求能優(yōu)化很多功能級(jí)應(yīng)用,同時(shí)我們介紹一下,通過(guò)B/S方式管理郵件組成員,添加程序后,如果添加的人員不在domino目錄下,在保存的時(shí)候會(huì)在控制臺(tái)輸出,方便查找郵件投遞故障。具體見下:

      1.我們首先創(chuàng)建用戶

      clip_image002

      創(chuàng)建郵件組,并且在郵件組內(nèi)添加人員。

      clip_image004

      我們將user01、user02添加到group-01組內(nèi)。

      clip_image006


      編輯好代理程序后,我們需要?jiǎng)?chuàng)建表單

      clip_image008


      然后

      clip_image010

      確認(rèn)完以上信息后,接下來(lái)我們創(chuàng)建代理程序,在此我們通過(guò)java程序來(lái)實(shí)現(xiàn)。

      為了保證不影響應(yīng)用系統(tǒng),建議創(chuàng)新新的數(shù)據(jù)庫(kù)來(lái)新建表單及代理程序。

      然后用desinger打開該數(shù)據(jù)庫(kù)

      clip_image012

      編輯代理程序

      clip_image014

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      import lotus.domino.*;
      import java.io.PrintWriter;
      import java.util.Vector;
      import java.lang.StringBuffer;
      public class JavaAgent extends AgentBase {
      public void NotesMain() {
      try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
      Document note=agentContext.getDocumentContext();
      String querystring=note.getItemValueString("query_string");
      String[] queryArray=querystring.split("&");
      querystring=queryArray[1].split("=")[1];
      System.out.println("請(qǐng)求內(nèi)容是:"+querystring);
      Database db=session.getDatabase(agentContext.getCurrentDatabase().getServer(), "names.nsf");
      if(db.isOpen()){
      }
      View personview=db.getView("_People");
      View groupview=db.getView("Groups");
      Document doc=groupview.getFirstDocument();
      Document tempdoc=null;
      Document persondoc=null;
      StringBuffer sb=new StringBuffer();
      while(doc!=null){
      tempdoc=doc;
      if(doc.getItemValueString("ListName").equals(querystring)){
      doc.appendItemValue("CN=Gavin/O=gavi000");
      doc.save();
      Vector v=session.evaluate("@name([ABBREVIATE];members)",doc);
      /*
      for(int i=0;i<v.size();i++){
      persondoc=personview.getDocumentByKey(v.get(i),true);
      if(persondoc==null){
      //MsgBox tempdoc.ListName(0) &"組下的"& key2(1) &"不在domino列表里!"
      System.out.println(doc.getItemValueString("ListName")+"組下的"+v.get(i)+"不在domino列表里!");
      }else{
      }
      }*/
      if(v.size()>0){
      for(int i=0;i<v.size()-1;i++){
      sb.append(v.get(i)+",");
      }
      sb.append(v.get(v.size()-1));
      }
      break;
      }
      doc=groupview.getNextDocument(doc);
      tempdoc.recycle();
      }
      PrintWriter pw = getAgentOutput();
      pw.println("Content-Type:text/plain;charset=gbk");
      pw.println(sb.toString());
      // (Your code goes here)
      } catch(Exception e) {
      e.printStackTrace();
      }
      }
      }

      首先我們要通過(guò)web去訪問(wèn)的話,先要?jiǎng)?chuàng)建表單及內(nèi)部自定義的信息

      新建名稱為web_group的表單

      定義顯示主題,因?yàn)槲覀冎黝}需要在頁(yè)面居中,所以應(yīng)用到了center參數(shù),

      <center>顯示內(nèi)容</center>

      編輯好,顯示內(nèi)容將在也面的中間顯示;

      接著定義需要搜索的的郵件組輸入框---域值,然后顯示郵件組成員的maillist,及搜索鍵、保存鍵盤

      clip_image016

      Maillist定義文本及文本框的大小

      clip_image018

      文本需要換行來(lái)輸入信息,可根據(jù)自己的需求來(lái)定義

      clip_image020

      定義搜索鍵的參數(shù)

      clip_image022


      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      xmlhttp=createXMLHttpRequest();
      if(xmlhttp){
      xmlhttp.open("GET","javajson?openagent&query="+document.forms[0].Mailgroup.value+"&t="+Math.random(),true);
      xmlhttp.onreadystatechange=function(){
      if(xmlhttp.readyState==4 && xmlhttp.status==200){
      document.forms[0].Maillist.value=xmlhttp.responseText.replace(/,/g,"\r\n");
      }
      }
      xmlhttp.send();
      }else
      alert("xmlhttp no found");


      clip_image024


      1
      2
      3
      4
      5
      function createXMLHttpRequest(){
      //var h=new ActiveXObject("Msxml2.XMLHTTP");
      var h = new XMLHttpRequest();
      return h;
      }

      clip_image026

      Document forms[0].submit();

      接下來(lái)我們?cè)L問(wèn)

      clip_image028


      clip_image030


      clip_image032


      clip_image034

      接下來(lái)我們添加用戶,然后如果添加的用戶不在domino目錄下保存,就會(huì)在控制臺(tái)提示

      clip_image036

      clip_image038

      本文出自 “高文龍” 博客,請(qǐng)務(wù)必保留此出處http://gaowenlong.blog.51cto.com/451336/1401225

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多