監(jiān)理公司管理系統(tǒng) | 工程企業(yè)管理系統(tǒng) | OA系統(tǒng) | ERP系統(tǒng) | 造價咨詢管理系統(tǒng) | 工程設計管理系統(tǒng) | 甲方項目管理系統(tǒng) | 簽約案例 | 客戶案例 | 在線試用
X 關閉
免費OA系統(tǒng)

當前位置:工程項目OA系統(tǒng) > 免費辦公軟件 > 免費OA系統(tǒng)

OA軟件也開始免費啦!來看哈他的文檔webservices接口

申請免費試用、咨詢電話:400-8352-114

第十部分 泛普免費OA文檔webservices接口
一. 泛普OA管理平臺接口說明
可以通過該接口對系統(tǒng)中的文檔進行一些操作,創(chuàng)建文檔、刪除文檔、更新文檔、查看文檔
二. 使用說明
一、 泛普OA軟件泛普OA系統(tǒng)系統(tǒng)文檔接口部署
1. 更新lib目錄下文件
將spring.jar更新為spring-1.2.6.jar
將xfire-all-1.1.2.jar更新為xfire-all-1.2.6.jar
添加xbean-spring-2.8.jar文件
 
2. 修改web.xml文件
在相應處增加servlet部署(參考系統(tǒng)中已有很多servlet部署),加入如下描述
  <servlet>
    <servlet-name>XFireServlet</servlet-name>
    <display-name>XFire Servlet</display-name>
<servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>XFireServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
注意:不要添加在注釋中(即以“<!—”開始至“-->”結束為注釋)!
 
3. 添加文件
在classes目錄中添加META-INF/xfire/services.xml
在classes目錄中添加以下class文件:
泛普OA系統(tǒng)docswebservicesDocAttachment.class
泛普OA系統(tǒng)docswebservicesDocCustomField.class
泛普OA系統(tǒng)docswebservicesDocInfo.class
泛普OA系統(tǒng)docswebservicesDocService.class
泛普OA系統(tǒng)docswebservicesDocServiceImpl.class
 
二、 泛普OA破解版接口使用
 
文檔接口采用標準的Web Service規(guī)范,因此可以使用標準的Web Service客戶端調用。
1. 客戶端所需lib
commons-discovery-0.2.jar
javax-wsdl_1.5.1jar
commons-logging_1.0.4.jar
axis.jar
jaxrpc.jar
saaj.jar
activation.jar
mail.jar
 
2. wsdl描述
在泛普OA系統(tǒng)系統(tǒng)中成功部署文檔Web Service接口后,訪問以下地址即可查看到該接口的wsdl描述:http://服務器:端口號/services/DocService?wsdl
 
 
3. 接口方法概述
名稱 參數 返回值 功能描述
login String loginid:用戶登陸名
String password :用戶登陸密碼
int logintype:登陸方式(0 數據庫驗證;1 動態(tài)密碼驗證;2 LDAP驗證)
String ipaddress:用戶IP地址 String:登陸Session碼 登陸驗證用戶,并根據返回隨Session碼
createDoc DocInfo docinfo:文檔信息對象
String sessioncode:登陸Session碼 int:1 成功 0 失敗 根據文檔對象創(chuàng)建文檔
updateDoc DocInfo docinfo:文檔信息對象
String sessioncode:登陸Session碼 int:1 成功 0 失敗 根據文檔對象修改文檔
deleteDoc int id:文檔ID
String sessioncode:登陸Session碼 int:1 成功 0 失敗 根據文檔ID刪除文檔
getDoc int id:文檔ID
String sessioncode:登陸Session碼 DocInfo:文檔對象 根據文檔ID取得文檔對象(帶文檔內容及附件)
getDocCount String sessioncode:登陸Session碼 int:文檔數 取得有權限訪問的文檔數
getList String sessioncode:登陸Session碼 DocInfo[]:文檔對象數組 取得有權限訪問的文檔對象數組(無文檔內容及附件)
 
4. 接口調用示例
使用eclipse向導生成Web Service客戶端
 
 
 
完成后,創(chuàng)建調用程序后,寫入如下代碼:
    public static void main(String[] args) {
    try {
    //根據Eclipse生成的Web Service客戶端程序,取得接口
    DocServicePortType service = new DocServiceLocator().getDocServiceHttpPort(new URL("http://localhost:8080//services/DocService"));
    //登陸
    String session = service.login("zdp", "1", 0, "127.0.0.1");
    //取得有權限訪問的文檔數
    int count = service.getDocCount(session);
   
    //取得有權限訪問的文檔列表,第1頁,每頁10條記錄
    DocInfo[] docs1 = service.getList(session,1,10);
    //取得有權限訪問的文檔列表,第2頁,每頁10條記錄
    DocInfo[] docs2 = service.getList(session,2,10);
    //循環(huán)打印取得的文檔的ID、標題、主目錄ID、主目錄名稱、分目錄ID、分目錄名稱、
    //子目錄ID、子目錄名稱、文檔創(chuàng)建人ID、文檔創(chuàng)建人名稱、創(chuàng)建日期、創(chuàng)建時間
    for(int i=0;i<docs1.length;i++) 
    System.out.println(docs1[i].getId()+"|"+docs1[i].getDocSubject()+"|"+
docs1[i].getMaincategory()+"|"+docs1[i].getMaincategoryStr()+"|"+
docs1[i].getSubcategory()+"|"+docs1[i].getSubcategoryStr()+"|"+
    docs1[i].getSeccategory()+"|"+docs1[i].getSeccategoryStr()+"|"+
    docs1[i].getDoccreaterid()+"|"+docs1[i].getDoccreatername()+"|"+
    docs1[i].getDoccreatedate()+"|"+docs1[i].getDoccreatetime());
 
    //根據ID取得文檔內容
    DocInfo doc = service.getDoc(13095,session);
    //取得該文檔的第一個附件
    DocAttachment da = doc.getAttachments()[0];
    //得到附件內容
    byte[] content = Base64.decode(da.getFilecontent());
    //得到附件在服務器上的絕對路徑
    String filepath = da.getFilerealpath();
 
    //將附件內容轉存至D:
    File file = new File("d:\"+da.getFilename());
try {
int byteread;
byte data[] = new byte[1024];
InputStream imagefile = null;
if(da.getIszip()==1){
ZipInputStream zin = new ZipInputStream(new ByteArrayInputStream(content));
if (zin.getNextEntry() != null)
imagefile = new BufferedInputStream(zin);
} else {
imagefile = new ByteArrayInputStream(content);
}
OutputStream out = new FileOutputStream(file);
while ((byteread = imagefile.read(data)) != -1) {
out.write(data, 0, byteread);
out.flush();
}
imagefile.close();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
 
//根據絕對路徑轉存附件(僅限與泛普OA系統(tǒng)系統(tǒng)在同一服務器上)
try {
int byteread;
byte data[] = new byte[1024];
InputStream imagefile = null;
if(da.getIszip()==1){
ZipInputStream zin = new ZipInputStream(new FileInputStream(new File(da.getFilerealpath())));
if (zin.getNextEntry() != null)
imagefile = new BufferedInputStream(zin);
} else {
imagefile = new FileInputStream(new File(da.getFilerealpath()));
}
   
OutputStream out = new FileOutputStream(file);
while ((byteread = imagefile.read(data)) != -1) {
out.write(data, 0, byteread);
out.flush();
}
imagefile.close();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
 
 
//上傳附件,更新文檔
content = null;
try {
int byteread;
byte data[] = new byte[1024];
InputStream input = new FileInputStream(new File("d:\123.pdf"));
 
ByteArrayOutputStream out = new ByteArrayOutputStream();
while ((byteread = input.read(data)) != -1) {
out.write(data, 0, byteread);
out.flush();
}
content = out.toByteArray();
input.close();
out.close();
} catch(Exception e){
e.printStackTrace();
}
da.setDocid(doc.getId());
da.setImagefileid(0);
da.setFilecontent(Base64.encode(content));
da.setIszip(1);
 
doc.setDocSubject("test");
doc.setDoccontent("content");
doc.setAttachments(new DocAttachment[]{da});
service.updateDoc(doc, session);
 
//上傳附件,創(chuàng)建文檔
content = null;
try {
int byteread;
byte data[] = new byte[1024];
InputStream input = new FileInputStream(new File("d:\123.pdf"));
 
ByteArrayOutputStream out = new ByteArrayOutputStream();
while ((byteread = input.read(data)) != -1) {
out.write(data, 0, byteread);
out.flush();
}
content = out.toByteArray();
input.close();
out.close();
} catch(Exception e){
e.printStackTrace();
}
 
da.setDocid(0);
da.setImagefileid(0);
da.setFilecontent(Base64.encode(content));
da.setFilerealpath("d:\123.pdf");
da.setIszip(1);
 
doc.setId(0);
doc.setDocSubject("test pdf1");
doc.setDoccontent("abcefghijk");
doc.setAttachments(new DocAttachment[]{da});
service.createDoc(doc, session);
    } catch(Exception e) {
    e.printStackTrace();
    }
}
 
5. 文檔對象說明
DocInfo
/**
* 文檔ID
*/
private int id;
 
/**
* 文檔類型
* 1 Html文檔 2 Office文檔
*/
private int docType;
 
/**
* 文檔標題
*/
private String docSubject;
 
/**
* 文檔編號
*/
private String docCode;
 
/**
* 新聞類型
*/
private int docPublishType;
private String publishable;
 
/**
* 文檔版本
*/
private int docEdition;
private int docEditionId;
private String docEditionStr;
 
/**
* 文檔狀態(tài)
*/
private int docStatus;
private String docStatusStr;
 
/**
*  主目錄
*/
private int maincategory;
private String maincategoryStr;
 
/**
* 分目錄
*/
private int subcategory;
private String subcategoryStr;
 
/**
* 子目錄
*/
private int seccategory;
private String seccategoryStr;
 
/**
* 部門
*/
private int docdepartmentid;
private String docdepartmentStr;
 
/**
* 語言
*/
private int doclangurage;
private String doclangurageStr;
 
/**
* 關鍵字
*/
private String keyword;
 
/**
* 創(chuàng)建
*/
private int doccreaterid;
private int doccreatertype;
private String doccreatername;
private String doccreatedate;
private String doccreatetime;
 
/**
* 修改
*/
private int doclastmoduserid;
private int doclastmodusertype;
private String doclastmodusername;
private String doclastmoddate;
private String doclastmodtime;
 
/**
* 批準
*/
private int docapproveuserid;
private int docapproveusertype;
private String docapproveusername;
private String docapprovedate;
private String docapprovetime;
 
/**
* 失效
*/
private int docinvaluserid;
private int docinvalusertype;
private String docinvalusername;
private String docinvaldate;
private String docinvaltime;
 
/**
* 歸檔
*/
private int docarchiveuserid;
private int docarchiveusertype;
private String docarchiveusername;
private String docarchivedate;
private String docarchivetime;
 
/**
* 作廢
*/
private int doccanceluserid;
private int doccancelusertype;
private String doccancelusername;
private String doccanceldate;
private String doccanceltime;
 
/**
* 主文檔
*/
private int maindoc;
private String maindocname;
 
/**
* 被引用列表 
*/
private int[] childdoc;
private String[] chiledocname;
 
/**
* 文檔所有者
*/
private int ownerid;
private int ownertype;
private String ownername;
 
/**
* 失效時間
*/
private String invalidationdate;
 
/**
* 虛擬目錄
*/
private int[] dummyIds;
private String[] dummyNames;
 
/**
* 自定義字段
*/
private DocCustomField[] doccustomfields;
 
/**
* 關聯類型
*/
private int hrmresid;
private int assetid;
private int CRMid;
private int itemid;
private int projectid;
private int financeid;
 
/**
* HTML文檔內容
*/
private String doccontent;
 
/**
* Office文檔內容
*/
private int imagefileId;
private int versionId;
 
/**
* 是否回復文檔
*/
private String isreply;
private int replydocid;
 
/**
* 附件數
*/
private int accessorycount;
 
/**
* 回復數
*/
private int replaydoccount;
 
/**
* 文檔附件
*/
private DocAttachment[] attachments;
 
 
DocCustomField
 
/**
* 自定義字段ID
*/
private int fieldid;
 
/**
* 自定義字段顯示類型
*/
private String fieldhtmltype;
 
/**
* 自定義字段存儲類型
*/
private String fielddbtype;
 
/**
* 自定義字段類型
*/
private int fieldtype;
 
/**
* 自定義字段顯示名稱
*/
private String fieldshow;
 
/**
* 自定義字段值
*/
private String fieldvalue;
 
 
DocAttachment
 
/**
* 文檔ID
*/
private int docid;
 
/**
* 附件ID
*/
private int imagefileid;
 
/**
* 附件名稱
*/
private String imagefilename;
 
/**
* 附件描述
*/
private String imagefiledesc;
 
/**
* 附件寬度(圖片文件)
*/
private int imagefilewidth;
 
/**
* 附件高度(圖片文件)
*/
private int imagefileheight;
 
/**
* 附件大小
*/
private int imagefilesize;
 
/**
* 附件類型
*/
private String docfiletype;
 
/**
* 附件版本
*/
private int versionId;
 
/**
* 附件版本描述
*/
private String versionDetail;
 
/**
* 是否Office文檔內容附件
*/
private String isextfile;
 
/**
* 文件名稱
*/
private String filename;
 
/**
* 文件類型
*/
private String filetype;
 
/**
* 文件使用次數
*/
private int fileused;
 
/**
* 文件絕對路徑
*/
private String filerealpath;
 
/**
* 文件內容Base64后編碼
*/
private String filecontent;
 
/**
* 是否壓縮
*/
private int iszip;
 
發(fā)布:2006-04-22 15:19    編輯:泛普軟件 · admin    [打印此頁]    [關閉]
相關文章:

泛普免費OA系統(tǒng)其他應用

免費ERP系統(tǒng) OA辦公系統(tǒng)免費版 免費OA系統(tǒng) 免費ERP 免費財務軟件 財務軟件免費版 合同管理軟件免費版 管家婆進銷存免費版 小管家進銷存免費版 生財寶進銷存免費版 免費網店管理軟件 服裝管理系統(tǒng)免費版 免費廣告公司管理系統(tǒng) 房地產銷售軟件下載 免費開源系統(tǒng) 免費辦公管理系統(tǒng) 免費審批系統(tǒng) 免費辦公用品管理軟件 免費上網行為管理系統(tǒng) 免費公文管理系統(tǒng) 免費流程管理軟件 免費商務管理軟件 免費稱重管理軟件 免費訂單管理系統(tǒng) 免費公司管理軟件 免費信息管理系統(tǒng) 業(yè)務流程管理軟件免費 免費時間管理軟件 免費目標管理軟件 免費協同管理軟件 免費企業(yè)OA辦公系統(tǒng)