public static void createDocDir() throws UnsupportedEncodingException, DocumentException, Exception{
Docs docs = new Docs();
docs.addDirs("defaultDocNameSpace", "归档中心/180808/文件");//创建目录
Table table = docs.getTable();
Iterator it = table.iterator();
String docDirID = "";
while (it.hasNext()){
Row r = (Row) it.next();
System.out.println(r.getString("sDocName"));
if(r.getString("sDocName").equals("文件")){
docDirID = r.getString("SA_DocNode");//获取创建的目录生成的docID
}
}
docs.save();//保存对当前容器所做的修改,需要存储到数据库的会存储数据库,需要同步文档服务的会同步到文档服务。
}
注意:在自己的模块中调用Doc相关的API操作是需要如下操作:
1.在自己的code目录下的model.config.xml中添加/SA/doc/logic/code的引用
2.把/SA/doc/logic/code下的右键设置为源码路径
3.在BIZ的构建路径中把tomcat\lib下的servelt-api.jar导入