Request URI: /fcr:tx; /tx:{transaction_id}/path/to/resource, /tx:{transaction_id}/fcr:tx, /tx:{transaction_id}/fcr:commit, /tx:{transaction_id}/fcr:rollback Methods: GET, POST Get the current status of the repository in a transactionExample:
Response:
Status: OK: If the request was successful Gone: Transaction not found Create a new transaction
Example:
Response:
Usage: When a transaction has been created, it will return a Location header. Use this location as the base URL for performing REST API operations within the transaction. When you are done with the transaction, either append "/fcr:tx/fcr:commit" to commit the transaction to the repository or "/fcr:tx/fcr:rollback" to discard the changes.
Status: Created: if the transaction is created successfully
|
curl -i -X POST "http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b5/fcr:tx" |
Response:
Status: 204 No Content Headers: Location: http://localhost:8080/rest/tx:83e34464-144e-43d9-af13-b3464a1fb9b5 Expires: Sat, 16 Nov 2013 03:35:43 GMT |
Status:
No Content: if the transaction is renewed successfully
Gone: if the transaction doesn't exist
Any operations you made within the scope of the transaction will be applied together, meaning if any of them fail, the whole transaction will fail.
Example:
curl -i -X POST "http://localhost:8080/rest/tx:123456789/fcr:tx/fcr:commit" |
Response:
Status: 204 No Content |
Status:
No Content: if the transaction is committed successfully
Gone: if the transaction doesn't exist
Example:
curl -i -X POST "http://localhost:8080/rest/tx:123456789/fcr:tx/fcr:rollback" |
Response:
Status: 204 No Content |
Status:
No Content: if the transaction is discarded successfully
Gone: if the transaction doesn't exist