class SoapDocumentService extends AbstractService implements DocumentService {

	@Override
	public WSDocument[] getDocuments(String sid, Long[] docIds) throws Exception {
		User user = validateSession(sid);
		FolderDAO fdao = (FolderDAO) Context.get().getBean(FolderDAO.class);
		Collection<Long> folderIds = fdao.findFolderIdByUserId(user.getId(), null, true);

		DocumentDAO docDao = (DocumentDAO) Context.get().getBean(DocumentDAO.class);
		List<Document> docs = docDao.findByIds(docIds, null);
		List<WSDocument> wsDocs = new ArrayList<WSDocument>();
		for (int i = 0; i < docs.size(); i++) {
			try {
				checkPublished(user, docs.get(i));
				checkNotArchived(docs.get(i));
			} catch (Throwable t) {
				continue;
			}
			if (user.isMemberOf("admin") || folderIds.contains(docs.get(i).getFolder().getId()))
				wsDocs.add(getDoc(docs.get(i).getId()));
		}

		return wsDocs.toArray(new WSDocument[0]);
	}

}