Class ExternalPropertyUtils

java.lang.Object
com._1c.g5.v8.dt.compare.merge.ExternalPropertyUtils

public class ExternalPropertyUtils extends Object
Utility methods of external property Comparison and Merge.
  • Field Details

  • Method Details

    • executeExternalMergeTool

      public static ExternalMergeToolExecutionStatus executeExternalMergeTool(ExternalPropertyComparisonNode node, IComparisonSession session, String symlinkPostfix, boolean isMerge, boolean runAutoMerge, File mergeResultFile, String mainComparisonSideName, String otherComparisonSideName, IExternalMergeToolProvider externalMergeToolProvider, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter) throws IOException
      Executes external merge tool for external property. Runs compare or merge, depends on parameters.
      Parameters:
      node - the external property comparison node, should not be one side, cannot be null
      session - the comparison session, cannot be null
      symlinkPostfix - the symlink postfix, cannot be null
      isMerge - true if run merge using external tool, and false if start comparison
      runAutoMerge - true if needed to run automatic merge, false otherwise
      mergeResultFile - the file to store merge result, can be null only if isMerge is false
      mainComparisonSideName - the main comparison side name, cannot be null
      otherComparisonSideName - the other comparison side name, cannot be null
      externalMergeToolProvider - the external merge tool provider, cannot be null
      symbolicLinkLocalizer - the symbolic link localizer, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the external merge tool execution status, never null
      Throws:
      IOException - if failed to read content
    • runExternalMergeTool

      public static ExternalMergeToolExecutionStatus runExternalMergeTool(IExternalMergeToolProvider externalMergeToolProvider, InputStream mainStream, InputStream otherStream, InputStream ancestorStream, File mergeResultFile, String mainTitle, String otherTitle, String ancestorTitle, boolean isMerge, boolean runAutoMerge, boolean isThreeWay)
      Runs external merge tool for external property. Runs compare or merge, depends on parameters.
      Parameters:
      externalMergeToolProvider - the external merge tool provider, cannot be null
      mainStream - the main stream to process, cannot be null
      otherStream - the other stream to process, cannot be null
      ancestorStream - the ancestor stream to process, may be null
      mergeResultFile - the file to store merge result, can be null only if isMerge is false
      mainTitle - the main title, cannot be null
      otherTitle - the other title, cannot be null
      ancestorTitle - the ancestor title, cannot be null
      isMerge - true if run merge using external tool, and false if start comparison
      runAutoMerge - true if needed to run automatic merge, false otherwise
      isThreeWay - true if is three way comparison/merge, false otherwise
      Returns:
      the external merge tool execution status, never null
    • readContentOnMerge

      public static String readContentOnMerge(ExternalPropertyComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Reads the external property content on the specified comparison side during merge.
      Parameters:
      node - the external property node for which to read content, cannot be null
      mergeSession - the merge session, cannot be null
      side - the comparison side to read content on, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the external property content, may be null
    • getContentStream

      public static InputStream getContentStream(ExternalPropertyComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Gets the external property content stream on the specified comparison side.
      Parameters:
      node - the external property comparison node for which to get content stream, cannot be null
      session - the comparison session, cannot be null
      side - the comparison side to get content stream on, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the content stream or null if there is no external property on the specified
    • getContentStreamOnMerge

      public static InputStream getContentStreamOnMerge(ExternalPropertyComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Gets the external property content stream on the specified comparison side during merge.
      Parameters:
      node - the external property comparison node for which to get content stream, cannot be null
      mergeSession - the merge session, cannot be null
      side - the comparison side to get content stream on, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the content stream or null if there is no external property on the specified
    • getPath

      public static Path getPath(ExternalPropertyComparisonNode node, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter)
      Gets file path for the external property node of given comparison side.
      Parameters:
      node - the external property node to get path for, cannot be null
      side - the side from which path must be retrieved, cannot be null
      filePathConverter - the file path converter, cannot be null
      Returns:
      the file path of resource related with node, can be null
    • isTemplateSupportManualMerge

      public static boolean isTemplateSupportManualMerge(ExternalPropertyComparisonNode node, IComparisonSession session)
      Tells if template support manual merge. Now condition can be achieved only when each side's qualifying type is either TEXT_DOCUMENT_TEMPLATE or null.
      Parameters:
      node - external property node to check possibility to open manual merge editor, cannot be null
      session - the comparison session, cannot be null
      Returns:
      true if editor can be opened, false otherwise
    • isTextDocumentTemplatesComparisonNode

      public static boolean isTextDocumentTemplatesComparisonNode(SolidResourceComparisonNode node, IComparisonSession session)
      Tells if template is a text document. Condition can be achieved only when each side's qualifying type is either TEXT_DOCUMENT_TEMPLATE or null.
      Parameters:
      node - solid resource comparison node to check, cannot be null
      session - the comparison session, cannot be null
      Returns:
      true if template is a text document, false otherwise