Connection conn = null;
try {
if (this.conn==null) conn = getConn(); else conn = this.conn;
bean.setConn(conn);
DocumentPK pk = null;
stmt = conn.createStatement();
Response res = null;
ArrayList versions = null;
DocumentVersionVO versionVO = null;
for(int i=0;i<list.size();i++) {
pk = (DocumentPK)list.get(i);
// retrieve all document versions...
res = bean.loadDocumentVersions(pk,new GridParams(),serverLanguageId,username);
if (res.isError())
throw new Exception(res.getErrorMessage());
versions = new ArrayList(((VOListResponse)res).getRows());
// for each document version: delete record in DOC15 and delete file from file system...
res = deleteDocumentVersions(versions,serverLanguageId,username,docPath);
if (res.isError()) {
throw new Exception(res.getErrorMessage());
}
// phisically delete document links from DOC17...
stmt.execute("delete from DOC17_DOCUMENT_LINKS where "+
"COMPANY_CODE_SYS01='"+pk.getCompanyCodeSys01DOC14()+"' and "+
"PROGRESSIVE_DOC14="+pk.getProgressiveDOC14());
// phisically delete the record in DOC14...
stmt.execute(
"delete from DOC14_DOCUMENTS where "+
"COMPANY_CODE_SYS01='"+pk.getCompanyCodeSys01DOC14()+"' and "+
"PROGRESSIVE="+pk.getProgressiveDOC14()
);
}
return new VOResponse(new Boolean(true));