Search in sources :

Example 66 with EntityNotFoundException

use of org.alfresco.rest.framework.core.exceptions.EntityNotFoundException 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

EntityNotFoundException (org.alfresco.rest.framework.core.exceptions.EntityNotFoundException)66 NodeRef (org.alfresco.service.cmr.repository.NodeRef)28 InvalidArgumentException (org.alfresco.rest.framework.core.exceptions.InvalidArgumentException)24 PermissionDeniedException (org.alfresco.rest.framework.core.exceptions.PermissionDeniedException)16 QName (org.alfresco.service.namespace.QName)15 ConstraintViolatedException (org.alfresco.rest.framework.core.exceptions.ConstraintViolatedException)12 SiteInfo (org.alfresco.service.cmr.site.SiteInfo)12 HashMap (java.util.HashMap)11 InvalidNodeRefException (org.alfresco.service.cmr.repository.InvalidNodeRefException)11 ArrayList (java.util.ArrayList)9 WebApiDescription (org.alfresco.rest.framework.WebApiDescription)8 InvalidSharedIdException (org.alfresco.service.cmr.quickshare.InvalidSharedIdException)7 Serializable (java.io.Serializable)6 FileInfo (org.alfresco.service.cmr.model.FileInfo)6 HistoricProcessInstance (org.activiti.engine.history.HistoricProcessInstance)5 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)5 ActivitiScriptNode (org.alfresco.repo.workflow.activiti.ActivitiScriptNode)5 ApiException (org.alfresco.rest.framework.core.exceptions.ApiException)5 ActivitiObjectNotFoundException (org.activiti.engine.ActivitiObjectNotFoundException)4 HistoricVariableInstance (org.activiti.engine.history.HistoricVariableInstance)4