use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordFolderEntityResource method readById.
@WebApiDescription(title = "Get record folder information", description = "Gets information for a record folder with id 'recordFolderId'")
@WebApiParam(name = "recordFolderId", title = "The record folder id")
public RecordFolder readById(String recordFolderId, Parameters parameters) {
checkNotBlank("recordFolderId", recordFolderId);
mandatory("parameters", parameters);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(recordFolderId, RecordsManagementModel.TYPE_RECORD_FOLDER);
FileInfo info = fileFolderService.getFileInfo(nodeRef);
return nodesModelFactory.createRecordFolder(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordsEntityResource method update.
@Override
@WebApiDescription(title = "Update record", description = "Updates a record with id 'recordId'")
public Record update(String recordId, Record recordInfo, Parameters parameters) {
checkNotBlank("recordId", recordId);
mandatory("recordInfo", recordInfo);
mandatory("parameters", parameters);
// Get record
NodeRef record = apiUtils.validateRecord(recordId);
// update info
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() {
public Void execute() {
apiUtils.updateNode(record, recordInfo, parameters);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(callback, false, true);
// return record state
RetryingTransactionCallback<FileInfo> readCallback = new RetryingTransactionCallback<FileInfo>() {
public FileInfo execute() {
return fileFolderService.getFileInfo(record);
}
};
FileInfo info = transactionService.getRetryingTransactionHelper().doInTransaction(readCallback, false, true);
apiUtils.postActivity(info, recordInfo.getParentId(), ActivityType.FILE_UPDATED);
return nodesModelFactory.createRecord(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordsEntityResource method delete.
@Override
@WebApiDescription(title = "Delete record", description = "Deletes a record with id 'recordId'")
public void delete(String recordId, Parameters parameters) {
checkNotBlank("recordId", recordId);
mandatory("parameters", parameters);
NodeRef record = apiUtils.validateRecord(recordId);
fileFolderService.delete(record);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordsEntityResource method readById.
@WebApiDescription(title = "Get record information", description = "Gets information for a record with id 'recordId'")
@WebApiParam(name = "recordId", title = "The record id")
public Record readById(String recordId, Parameters parameters) {
checkNotBlank("recordId", recordId);
mandatory("parameters", parameters);
NodeRef record = apiUtils.validateRecord(recordId);
FileInfo info = fileFolderService.getFileInfo(record);
return nodesModelFactory.createRecord(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class TransferEntityResource method readById.
@Override
@WebApiDescription(title = "Get transfer information", description = "Gets information for a transfer with id 'transferId'")
@WebApiParam(name = "transferId", title = "The transfer id")
public Transfer readById(String transferId, Parameters parameters) throws EntityNotFoundException {
checkNotBlank("transferId", transferId);
mandatory("parameters", parameters);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(transferId, RecordsManagementModel.TYPE_TRANSFER);
FileInfo info = fileFolderService.getFileInfo(nodeRef);
return nodesModelFactory.createTransfer(info, parameters, null, false);
}
Aggregations