use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class UnfiledRecordFolderEntityResource method readById.
@WebApiDescription(title = "Get unfiled record folder information", description = "Gets information for an unfiled record folder with id 'unfiledRecordFolderId'")
@WebApiParam(name = "unfiledRecordFolderId", title = "The unfiled record folder id")
public UnfiledRecordFolder readById(String unfiledRecordFolderId, Parameters parameters) {
checkNotBlank("unfiledRecordFolderId", unfiledRecordFolderId);
mandatory("parameters", parameters);
String relativePath = parameters.getParameter(Nodes.PARAM_RELATIVE_PATH);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(unfiledRecordFolderId, RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER, relativePath, true);
FileInfo info = fileFolderService.getFileInfo(nodeRef);
return nodesModelFactory.createUnfiledRecordFolder(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class UnfiledRecordFolderEntityResource method delete.
@Override
@WebApiDescription(title = "Delete unfiled record folder", description = "Deletes an unfiled record folder with id 'unfiledRecordFolderId'")
public void delete(String unfiledRecordFolderId, Parameters parameters) {
checkNotBlank("unfiledRecordFolderId", unfiledRecordFolderId);
mandatory("parameters", parameters);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(unfiledRecordFolderId, RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER);
fileFolderService.delete(nodeRef);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordCategoriesEntityResource method readById.
@WebApiDescription(title = "Get record category information", description = "Gets information for a record category with id 'recordCategoryId'")
@WebApiParam(name = "recordCategoryId", title = "The record category id")
public RecordCategory readById(String recordCategoryId, Parameters parameters) {
checkNotBlank("recordCategoryId", recordCategoryId);
mandatory("parameters", parameters);
String relativePath = parameters.getParameter(Nodes.PARAM_RELATIVE_PATH);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(recordCategoryId, RecordsManagementModel.TYPE_RECORD_CATEGORY, relativePath, true);
FileInfo info = fileFolderService.getFileInfo(nodeRef);
return nodesModelFactory.createRecordCategory(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordCategoriesEntityResource method update.
@Override
@WebApiDescription(title = "Update record category", description = "Updates a record category with id 'recordCategoryId'")
public RecordCategory update(String recordCategoryId, RecordCategory recordCategoryInfo, Parameters parameters) {
checkNotBlank("recordCategoryId", recordCategoryId);
mandatory("recordCategoryInfo", recordCategoryInfo);
mandatory("parameters", parameters);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(recordCategoryId, RecordsManagementModel.TYPE_RECORD_CATEGORY);
RetryingTransactionCallback<Void> callback = new RetryingTransactionCallback<Void>() {
public Void execute() {
apiUtils.updateNode(nodeRef, recordCategoryInfo, parameters);
return null;
}
};
transactionService.getRetryingTransactionHelper().doInTransaction(callback, false, true);
RetryingTransactionCallback<FileInfo> readCallback = new RetryingTransactionCallback<FileInfo>() {
public FileInfo execute() {
return fileFolderService.getFileInfo(nodeRef);
}
};
FileInfo info = transactionService.getRetryingTransactionHelper().doInTransaction(readCallback, false, true);
return nodesModelFactory.createRecordCategory(info, parameters, null, false);
}
use of org.alfresco.rest.framework.WebApiDescription in project records-management by Alfresco.
the class RecordCategoriesEntityResource method delete.
@Override
@WebApiDescription(title = "Delete record category", description = "Deletes a record category with id 'recordCategoryId'")
public void delete(String recordCategoryId, Parameters parameters) {
checkNotBlank("recordCategoryId", recordCategoryId);
mandatory("parameters", parameters);
NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(recordCategoryId, RecordsManagementModel.TYPE_RECORD_CATEGORY);
fileFolderService.delete(nodeRef);
}
Aggregations