Codota Logo
ContentService.createContentItemQuery
Code IndexAdd Codota to your IDE (free)

How to use
createContentItemQuery
method
in
org.flowable.content.api.ContentService

Best Java code snippets using org.flowable.content.api.ContentService.createContentItemQuery (Showing top 13 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.flowable/flowable-content-engine

/**
 * Each test is assumed to clean up all DB content it entered. After a test method executed, this method scans all tables to see if the DB is completely clean. It throws AssertionFailed in case
 * the DB is not clean. If the DB is not clean, it is cleaned by performing a create a drop.
 */
public static void assertAndEnsureCleanDb(ContentEngine contentEngine) {
  LOGGER.debug("verifying that db is clean after test");
  ContentService contentService = contentEngine.getContentEngineConfiguration().getContentService();
  List<ContentItem> items = contentService.createContentItemQuery().list();
  if (items != null && !items.isEmpty()) {
    throw new AssertionError("ContentItem is not empty");
  }
}
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 ResultListDataRepresentation getContentItemsForTask(String taskId) {
  permissionService.validateReadPermissionOnTask(SecurityUtils.getCurrentUserObject(), taskId);
  return createResultRepresentation(contentService.createContentItemQuery().taskId(taskId).list());
}
origin: org.flowable/flowable-ui-task-rest

public ResultListDataRepresentation getContentItemsForProcessInstance(String processInstanceId) {
  // TODO: check if process exists
  if (!permissionService.hasReadPermissionOnProcessInstance(SecurityUtils.getCurrentUserObject(), processInstanceId)) {
    throw new NotPermittedException("You are not allowed to read the process with id: " + processInstanceId);
  }
  return createResultRepresentation(contentService.createContentItemQuery().processInstanceId(processInstanceId).list());
}
origin: org.flowable/flowable-ui-task-rest

public ResultListDataRepresentation getContentItemsForCase(String caseInstanceId) {
  permissionService.hasReadPermissionOnCase(SecurityUtils.getCurrentUserObject(), caseInstanceId);
  return createResultRepresentation(contentService.createContentItemQuery().scopeType("cmmn").scopeId(caseInstanceId).list());
}
origin: org.flowable/flowable-engine

@Override
public void enrichFormFields(FormInfo formInfo) {
  ContentService contentService = CommandContextUtil.getContentService();
  if (contentService == null) {
    return;
  }
  SimpleFormModel formModel = (SimpleFormModel) formInfo.getFormModel();
  if (formModel.getFields() != null) {
    for (FormField formField : formModel.getFields()) {
      if (FormFieldTypes.UPLOAD.equals(formField.getType())) {
        List<String> contentItemIds = null;
        if (formField.getValue() instanceof List) {
          contentItemIds = (List<String>) formField.getValue();
        } else if (formField.getValue() instanceof String) {
          String[] splittedString = ((String) formField.getValue()).split(",");
          contentItemIds = new ArrayList<>();
          Collections.addAll(contentItemIds, splittedString);
        }
        if (contentItemIds != null) {
          Set<String> contentItemIdSet = new HashSet<>(contentItemIds);
          List<ContentItem> contentItems = contentService.createContentItemQuery()
              .ids(contentItemIdSet)
              .list();
          formField.setValue(contentItems);
        }
      }
    }
  }
}
origin: org.flowable/flowable-cmmn-engine

@Override
public void enrichFormFields(FormInfo formInfo) {
  ContentService contentService = CommandContextUtil.getContentService();
  if (contentService == null) {
    return;
  }
  SimpleFormModel formModel = (SimpleFormModel) formInfo.getFormModel();
  if (formModel.getFields() != null) {
    for (FormField formField : formModel.getFields()) {
      if (FormFieldTypes.UPLOAD.equals(formField.getType())) {
        List<String> contentItemIds = null;
        if (formField.getValue() instanceof List) {
          contentItemIds = (List<String>) formField.getValue();
        } else if (formField.getValue() instanceof String) {
          String[] splittedString = ((String) formField.getValue()).split(",");
          contentItemIds = new ArrayList<>();
          Collections.addAll(contentItemIds, splittedString);
        }
        if (contentItemIds != null) {
          Set<String> contentItemIdSet = new HashSet<>(contentItemIds);
          List<ContentItem> contentItems = contentService.createContentItemQuery()
              .ids(contentItemIdSet)
              .list();
          formField.setValue(contentItems);
        }
      }
    }
  }
}
origin: org.flowable/flowable-cmmn-engine

Collections.addAll(contentItemIdSet, contentItemIds);
List<ContentItem> contentItems = contentService.createContentItemQuery().ids(contentItemIdSet).list();
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-engine

Collections.addAll(contentItemIdSet, contentItemIds);
List<ContentItem> contentItems = contentService.createContentItemQuery().ids(contentItemIdSet).list();
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());
}
origin: org.flowable/flowable-content-rest

protected DataResponse<ContentItemResponse> getContentItemsFromQueryRequest(ContentItemQueryRequest request, Map<String, String> requestParams) {
  ContentItemQuery contentItemQuery = contentService.createContentItemQuery();
org.flowable.content.apiContentServicecreateContentItemQuery

Popular methods of ContentService

  • saveContentItem
  • deleteContentItem
  • getContentItemData
  • newContentItem

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • startActivity (Activity)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JFileChooser (javax.swing)
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