congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ContentItemQuery
Code IndexAdd Tabnine to your IDE (free)

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

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

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-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 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 getContentItemsForTask(String taskId) {
  permissionService.validateReadPermissionOnTask(SecurityUtils.getCurrentUserObject(), taskId);
  return createResultRepresentation(contentService.createContentItemQuery().taskId(taskId).list());
}
origin: org.flowable/flowable-content-rest

contentItemQuery.id(request.getId());
contentItemQuery.ids(request.getIds());
contentItemQuery.name(request.getName());
contentItemQuery.nameLike(request.getNameLike());
contentItemQuery.mimeType(request.getMimeType());
contentItemQuery.mimeTypeLike(request.getMimeTypeLike());
contentItemQuery.taskId(request.getTaskId());
contentItemQuery.taskIdLike(request.getTaskIdLike());
contentItemQuery.processInstanceId(request.getProcessInstanceId());
contentItemQuery.processInstanceIdLike(request.getProcessInstanceIdLike());
contentItemQuery.contentStoreId(request.getContentStoreId());
contentItemQuery.contentStoreIdLike(request.getContentStoreIdLike());
contentItemQuery.contentStoreName(request.getContentStoreName());
contentItemQuery.contentStoreNameLike(request.getContentStoreNameLike());
contentItemQuery.contentSize(request.getContentSize());
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-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-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 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-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);
  }
}
org.flowable.content.apiContentItemQuery

Javadoc

Allows programmatic querying of ContentItems.

Most used methods

  • 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.
  • singleResult
  • 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.
  • contentStoreName,
  • contentStoreNameLike,
  • createdBy,
  • createdByLike,
  • createdDate,
  • createdDateAfter,
  • createdDateBefore,
  • field,
  • fieldLike,
  • lastModifiedBy

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • onRequestPermissionsResult (Fragment)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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