Class ExportSearchNodesHelper

java.lang.Object
fr.becpg.repo.report.helpers.ExportSearchNodesHelper

public final class ExportSearchNodesHelper extends Object

Stores the nodes of an asynchronous search export on their download node, as a JSON array in its cm:content property.

Attaching one association per exported node saturates the transactional caches and holds the database locks of the download node for the whole request: a single content write does not, and lets the client progress bar start without waiting. The content is later replaced by the produced archive once the export completes.
Version:
$Id: $Id
Author:
matthieu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.apache.commons.logging.Log
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.alfresco.service.cmr.repository.NodeRef[]
    readNodes(org.alfresco.service.cmr.repository.ContentService contentService, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef downloadNodeRef)
    Read back the nodes to export, or an empty array if the download node doesn't carry any: the caller then falls back on the associations of the download request.
    static void
    storeNodes(org.alfresco.service.cmr.repository.ContentService contentService, org.alfresco.service.cmr.repository.NodeRef downloadNodeRef, List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)
    Store the nodes to export on the download node.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • logger

      private static final org.apache.commons.logging.Log logger
  • Constructor Details

    • ExportSearchNodesHelper

      private ExportSearchNodesHelper()
  • Method Details

    • storeNodes

      public static void storeNodes(org.alfresco.service.cmr.repository.ContentService contentService, org.alfresco.service.cmr.repository.NodeRef downloadNodeRef, List<org.alfresco.service.cmr.repository.NodeRef> nodeRefs)

      Store the nodes to export on the download node.

      Parameters:
      contentService - a ContentService object
      downloadNodeRef - a NodeRef object
      nodeRefs - a List object
    • readNodes

      public static org.alfresco.service.cmr.repository.NodeRef[] readNodes(org.alfresco.service.cmr.repository.ContentService contentService, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef downloadNodeRef)

      Read back the nodes to export, or an empty array if the download node doesn't carry any: the caller then falls back on the associations of the download request.

      A node deleted between the search and the asynchronous export is left out: the exporter would fail on it and lose the whole archive, whereas it is simply out of scope.

      Parameters:
      contentService - a ContentService object
      nodeService - a NodeService object
      downloadNodeRef - a NodeRef object
      Returns:
      an array of NodeRef objects