@Override
 public String writeTags(Collection<TagInputBean> tagInputBeans) throws FlockException {
   Company company = securityHelper.getCompany();
   try {
     mediationFacade.createTags(company, tagInputBeans);
   } catch (ExecutionException | InterruptedException e) {
     throw new FlockException("Interrupted", e);
   }
   return null;
 }
Exemple #2
0
 @RequestMapping(value = "/{fortressCode:.*}/rebuild", method = RequestMethod.POST)
 @ResponseStatus(value = HttpStatus.ACCEPTED)
 public AdminResponse rebuildSearch(
     @PathVariable("fortressCode") String fortressCode, HttpServletRequest request)
     throws FlockException {
   Company company = CompanyResolver.resolveCompany(request);
   logger.info(
       "Reindex command received for "
           + fortressCode
           + " from ["
           + securityHelper.getLoggedInUser()
           + "]");
   String message = mediationFacade.reindex(company, fortressCode);
   return new AdminResponse(message);
 }
 @Override
 public String writeEntities(Collection<EntityInputBean> entityBatch) throws FlockException {
   Company company = securityHelper.getCompany();
   try {
     for (EntityInputBean entityInputBean : entityBatch) {
       mediationFacade.trackEntity(company, entityInputBean);
     }
     return "ok";
   } catch (InterruptedException e) {
     throw new FlockException("Interrupted", e);
   } catch (ExecutionException e) {
     throw new FlockException("Execution Problem", e);
   } catch (IOException e) {
     throw new FlockException("IO Exception", e);
   }
 }
 @Override
 public ContentModel getContentModel(String modelKey) throws IOException {
   String[] args = modelKey.split(":");
   // ToDo: this is not yet properly supported - needs to be tested with Tag fortress - which is
   // logical
   if (args.length == 2) {
     Company company = securityHelper.getCompany();
     Fortress fortress = fortressService.getFortress(company, args[0]);
     DocumentType docType = conceptService.findDocumentType(fortress, args[1]);
     try {
       return contentModelService.get(company, fortress, docType);
     } catch (FlockException e) {
       throw new IOException("Problem locating content model [" + modelKey + "]");
     }
   }
   return null;
 }
Exemple #5
0
  @RequestMapping(value = "/{fortressName:.*}/{docType}/validate", method = RequestMethod.POST)
  @ResponseStatus(value = HttpStatus.ACCEPTED)
  public AdminResponse validateFromSearch(
      @PathVariable("fortressName") String fortressName,
      @PathVariable("docType") String docType,
      HttpServletRequest request)
      throws FlockException {
    Company company = CompanyResolver.resolveCompany(request);

    logger.info(
        "Validate command received for "
            + fortressName
            + " & docType "
            + docType
            + " from ["
            + securityHelper.getLoggedInUser()
            + "]");
    String message = mediationFacade.validateFromSearch(company, fortressName, docType);

    return new AdminResponse(message);
  }
 @Override
 public SystemUserResultBean me() {
   return new SystemUserResultBean(securityHelper.getSysUser(false));
 }