Search in sources :

Example 11 with WebApiParam

use of org.alfresco.rest.framework.WebApiParam 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);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) WebApiDescription(org.alfresco.rest.framework.WebApiDescription) WebApiParam(org.alfresco.rest.framework.WebApiParam)

Example 12 with WebApiParam

use of org.alfresco.rest.framework.WebApiParam 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);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) WebApiDescription(org.alfresco.rest.framework.WebApiDescription) WebApiParam(org.alfresco.rest.framework.WebApiParam)

Example 13 with WebApiParam

use of org.alfresco.rest.framework.WebApiParam 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);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) WebApiDescription(org.alfresco.rest.framework.WebApiDescription) WebApiParam(org.alfresco.rest.framework.WebApiParam)

Example 14 with WebApiParam

use of org.alfresco.rest.framework.WebApiParam in project records-management by Alfresco.

the class FilePlanEntityResource method readById.

@WebApiDescription(title = "Get file plan information", description = "Get information for a file plan with id 'filePlanId'")
@WebApiParam(name = "filePlanId", title = "The file plan id")
public FilePlan readById(String filePlanId, Parameters parameters) {
    checkNotBlank("filePlanId", filePlanId);
    mandatory("parameters", parameters);
    QName filePlanType = apiUtils.getFilePlanType();
    if (// rm site not created
    filePlanType == null) {
        throw new EntityNotFoundException(filePlanId);
    }
    NodeRef nodeRef = apiUtils.lookupAndValidateNodeType(filePlanId, filePlanType);
    FileInfo info = fileFolderService.getFileInfo(nodeRef);
    return nodesModelFactory.createFilePlan(info, parameters, null, false);
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) FileInfo(org.alfresco.service.cmr.model.FileInfo) QName(org.alfresco.service.namespace.QName) EntityNotFoundException(org.alfresco.rest.framework.core.exceptions.EntityNotFoundException) WebApiDescription(org.alfresco.rest.framework.WebApiDescription) WebApiParam(org.alfresco.rest.framework.WebApiParam)

Aggregations

WebApiParam (org.alfresco.rest.framework.WebApiParam)14 WebApiDescription (org.alfresco.rest.framework.WebApiDescription)13 FileInfo (org.alfresco.service.cmr.model.FileInfo)11 NodeRef (org.alfresco.service.cmr.repository.NodeRef)11 RetryingTransactionCallback (org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback)3 UploadInfo (org.alfresco.rm.rest.api.model.UploadInfo)3 ArrayList (java.util.ArrayList)2 Annotation (java.lang.annotation.Annotation)1 NodeRating (org.alfresco.rest.api.model.NodeRating)1 Person (org.alfresco.rest.api.model.Person)1 EntityNotFoundException (org.alfresco.rest.framework.core.exceptions.EntityNotFoundException)1 MultiPartRelationshipResourceAction (org.alfresco.rest.framework.resource.actions.interfaces.MultiPartRelationshipResourceAction)1 RelationshipResourceAction (org.alfresco.rest.framework.resource.actions.interfaces.RelationshipResourceAction)1 QName (org.alfresco.service.namespace.QName)1 Pair (org.alfresco.util.Pair)1