src/de/uka/ipd/idaho/goldenGateServer/ims/GoldenGateIMS.java
/**
	 * Check out a document from IMS. The document will be protected from
	 * editing by other users until it is released through the releaseDocument()
	 * method.
	 * @param userName the user checking out the document
	 * @param documentId the ID of the document to check out
	 * @param version the version to load
	 * @return the document with the specified ID
	 * @throws IOException
	 */
Check out a document from IMS. The document will be protected from
editing by other users until it is released through the releaseDocument()
method.
Check out a document from IMS . The document will be protected from editing by other users until it is released through the releaseDocument () method .
public ImsDocumentData checkoutDocumentAsData(String userName, String documentId, int version) throws IOException {
		String checkoutUser = this.getCheckoutUser(documentId);
		if (checkoutUser == null)
			throw new IOException("Document does not exist.");
		if (!checkoutUser.equals("") && !checkoutUser.equals(userName))
			throw new DocumentCheckedOutException(this.showCheckoutUserOnError ? checkoutUser : null);
		long checkoutTime = System.currentTimeMillis();
		ImsDocumentData docData = this.doCheckoutDocumentAsData(userName, documentId, version, checkoutTime);
		this.logInfo("document " + documentId + " checked out by '" + userName + "'.");
		GoldenGateServerEventService.notify(new ImsDocumentEvent(userName, documentId, ImsDocumentEvent.CHECKOUT_TYPE, GoldenGateIMS.class.getName(), checkoutTime));
		return docData;
	}
public ImsDocumentData checkoutDocumentAsData ( String userName , String documentId , int version ) throws IOException { String checkoutUser = this . getCheckoutUser ( documentId ) ; if ( checkoutUser == null ) throw new IOException ( "Document does not exist." ) ; if ( ! checkoutUser . equals ( "" ) && ! checkoutUser . equals ( userName ) ) throw new DocumentCheckedOutException ( this . showCheckoutUserOnError ? checkoutUser : null ) ; long checkoutTime = System . currentTimeMillis ( ) ; ImsDocumentData docData = this . doCheckoutDocumentAsData ( userName , documentId , version , checkoutTime ) ; this . logInfo ( "document " + documentId + " checked out by '" + userName + "'." ) ; GoldenGateServerEventService . notify ( new ImsDocumentEvent ( userName , documentId , ImsDocumentEvent . CHECKOUT_TYPE , GoldenGateIMS . class . getName ( ) , checkoutTime ) ) ; return docData ; }
Check out a document from IMS.
Check out a document from IMS .
//	check if document exists //	check if checkout possible for user //	check out document //	log checkout and notify listeners //	load document on top of local cache folder