3.1.4.4.1 Get Lock

If the SchemaLockRequestType attribute is set to "GetLock", the protocol server considers this schema lock subrequest to be of type "Get lock". The protocol server processes the request to get a shared lock on the coauthorable file and joins the coauthoring session of the file by adding the client’s associated ClientID and timeout to the file coauthoring tracker.

If the file already has a shared lock on the server with the given schema lock identifier and the client has already joined the coauthoring session, the protocol server does both of the following:

  • Refresh the timeout value associated with the ClientID in the file coauthoring tracker.

  • Return an error code value set to "Success".

If the coauthoring feature is disabled on the protocol server, the server does one of the following:

  • If the AllowFallbackToExclusive attribute is set to true, the protocol server gets an exclusive lock on the file.

  • If the AllowFallbackToExclusive attribute is set to false, the protocol server returns an error code value set to "FileNotLockedOnServer".<50>

The AllowFallbackToExclusive attribute is defined in section 2.3.1.13. The result of the lock type obtained by the server MUST be sent as the LockType attribute in the SchemaLockSubResponseDataType. The SchemaLockSubResponseDataType is defined in section 2.3.1.15. The LockType attribute values are defined in section 2.2.5.9.

The protocol server returns an error code value set to "NumberOfCoauthorsReachedMax" when all of the following conditions are true:

  • The maximum number of coauthorable clients allowed to join a coauthoring session to edit a coauthorable file has been reached.

  • The current client is not allowed to edit the file because the limit has been reached.

If there is a current exclusive lock on the file or if there is a shared lock on the file with a different schema lock identifier, the protocol server returns an error code value set to "FileAlreadyLockedOnServer". If the coauthorable file is checked out on the server and it is checked out by a client with a different user name than the current client, the protocol server returns an error code value set to "FileAlreadyCheckedOutOnServer".

If any failure occurs such that the subrequest cannot be processed successfully, the protocol server returns an error. The error that the protocol server returns is implementation-specific. Errors that are directly returned by the protocol server are implementation-specific. LockAndCoauthRelatedErrorCodeTypes is defined in section 2.2.5.8, and generic error code types are defined in section 2.2.5.6. For other unknown error types, the protocol server returns an error code value set to "LockRequestFail".