class DocumentServiceImpl extends RemoteServiceServlet implements DocumentService {

	@Override
	public void lock(long[] docIds, String comment) throws ServerException {
		Session session = ServiceUtil.validateSession(getThreadLocalRequest());

		// Unlock the document; throws an exception if something
		// goes wrong
		DocumentManager documentManager = (DocumentManager) Context.get().getBean(DocumentManager.class);
		try {
			// Create the document history event
			DocumentHistory transaction = new DocumentHistory();
			transaction.setSession(session);
			transaction.setEvent(DocumentEvent.LOCKED.toString());
			transaction.setComment(comment);
			for (long id : docIds) {
				documentManager.lock(id, Document.DOC_LOCKED, transaction);
			}
		} catch (Throwable t) {
			ServiceUtil.throwServerException(session, log, t);
		}
	}

}