public void unassignContent(UnassignContentParams params) {
    final UserEntity unassigner = securityService.getImpersonatedPortalUser();

    UnassignContentCommand command = new UnassignContentCommand();
    command.setContentKey(new ContentKey(params.contentKey));
    command.setUnassigner(unassigner.getKey());
    contentService.unassignContent(command);
  }
示例#2
0
  private void doArchiveContent(
      UserEntity importer, ContentKey contentKey, ImportResult importResult) {
    final ContentEntity content = contentDao.findByKey(contentKey);

    if (content == null) {
      return;
    }

    boolean contentArchived = contentStorer.archiveMainVersion(importer, content);
    if (contentArchived) {
      importResult.addArchived(content);

      UnassignContentCommand unassignContentCommand = new UnassignContentCommand();
      unassignContentCommand.setContentKey(content.getKey());
      unassignContentCommand.setUnassigner(importer.getKey());
      contentStorer.unassignContent(unassignContentCommand);
    } else {
      importResult.addAlreadyArchived(content);
    }
  }