congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ContentItemQuery.singleResult
Code IndexAdd Tabnine 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)

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

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • BoxLayout (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now