Codota Logo
ContentItemQuery.singleResult
Code IndexAdd Codota to your IDE (free)

How to use
singleResult
method
in
org.flowable.content.api.ContentItemQuery

Best Java code snippets using org.flowable.content.api.ContentItemQuery.singleResult (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: org.flowable/flowable-content-rest

  protected ContentItem getContentItemFromRequest(String contentItemId) {
    ContentItem contentItem = contentService.createContentItemQuery().id(contentItemId).singleResult();
    if (contentItem == null) {
      throw new FlowableObjectNotFoundException("Could not find a content item with id '" + contentItemId + "'.", ContentItem.class);
    }
    
    if (restApiInterceptor != null) {
      restApiInterceptor.accessContentItemInfoById(contentItem);
    }
    
    return contentItem;
  }
}
origin: org.flowable/flowable-ui-task-rest

public ContentItemRepresentation getContent(String contentId) {
  ContentItem contentItem = contentService.createContentItemQuery().id(contentId).singleResult();
  if (contentItem == null) {
    throw new NotFoundException("No content found with id: " + contentId);
  }
  if (!permissionService.canDownloadContent(SecurityUtils.getCurrentUserObject(), contentItem)) {
    throw new NotPermittedException("You are not allowed to view the content with id: " + contentId);
  }
  return createContentItemResponse(contentItem);
}
origin: org.flowable/flowable-ui-task-rest

public void getRawContent(String contentId, HttpServletResponse response) {
  ContentItem contentItem = contentService.createContentItemQuery().id(contentId).singleResult();
  if (contentItem == null) {
    throw new NotFoundException("No content found with id: " + contentId);
  }
  if (!contentItem.isContentAvailable()) {
    throw new NotFoundException("Raw content not yet available for id: " + contentId);
  }
  if (!permissionService.canDownloadContent(SecurityUtils.getCurrentUserObject(), contentItem)) {
    throw new NotPermittedException("You are not allowed to read the content with id: " + contentId);
  }
  // Set correct mine-type
  if (contentItem.getMimeType() != null) {
    response.setContentType(contentItem.getMimeType());
  }
  // Write content response
  try (InputStream inputstream = contentService.getContentItemData(contentId)) {
    IOUtils.copy(inputstream, response.getOutputStream());
  } catch (IOException e) {
    throw new InternalServerErrorException("Error while writing raw content data for content: " + contentId, e);
  }
}
origin: org.flowable/flowable-ui-task-rest

public void deleteContent(String contentId, HttpServletResponse response) {
  ContentItem contentItem = contentService.createContentItemQuery().id(contentId).singleResult();
  if (contentItem == null) {
    throw new NotFoundException("No content found with id: " + contentId);
  }
  if (!permissionService.hasWritePermissionOnRelatedContent(SecurityUtils.getCurrentUserObject(), contentItem)) {
    throw new NotPermittedException("You are not allowed to delete the content with id: " + contentId);
  }
  if (contentItem.getField() != null) {
    // Not allowed to delete content that has been added as part of a form
    throw new NotPermittedException("You are not allowed to delete the content with id: " + contentId);
  }
  contentService.deleteContentItem(contentItem.getId());
}
org.flowable.content.apiContentItemQuerysingleResult

Popular methods of ContentItemQuery

  • list
  • ids
    Only select content items with the given ids.
  • id
    Only select content items with the given id.
  • processInstanceId
    Only select content items with the given process instance id.
  • taskId
    Only select content items with the given task id.
  • contentAvailable
    Only select content items with content available or not.
  • contentSize
    Only select content items with the given content size.
  • contentStoreId
    Only select content items with the given content store id.
  • contentStoreIdLike
    Only select content items with a content store id like the given string.
  • contentStoreName
    Only select content items with the given content store name.
  • contentStoreNameLike
    Only select content items with a content store name like the given string.
  • createdBy
    Only select content items with the given created by value.
  • contentStoreNameLike,
  • createdBy,
  • createdByLike,
  • createdDate,
  • createdDateAfter,
  • createdDateBefore,
  • field,
  • fieldLike,
  • lastModifiedBy

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now