Package com._1c.g5.v8.dt.compare.merge
Class ExternalPropertyUtils
java.lang.Object
com._1c.g5.v8.dt.compare.merge.ExternalPropertyUtils
Utility methods of external property Comparison and Merge.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionexecuteExternalMergeTool(ExternalPropertyComparisonNode node, IComparisonSession session, String symlinkPostfix, boolean isMerge, boolean runAutoMerge, File mergeResultFile, String mainComparisonSideName, String otherComparisonSideName, IExternalMergeToolProvider externalMergeToolProvider, ISymbolicLinkLocalizer symbolicLinkLocalizer, IQualifiedNameFilePathConverter filePathConverter) Executes external merge tool for external property.static InputStreamgetContentStream(ExternalPropertyComparisonNode node, IComparisonSession session, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Gets the external property content stream on the specified comparison side.static InputStreamgetContentStreamOnMerge(ExternalPropertyComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Gets the external property content stream on the specified comparison side during merge.static PathgetPath(ExternalPropertyComparisonNode node, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Gets file path for the external property node of given comparison side.static booleanTells if template support manual merge.static booleanTells if template is a text document.static StringreadContentOnMerge(ExternalPropertyComparisonNode node, IMergeSession mergeSession, ComparisonSide side, IQualifiedNameFilePathConverter filePathConverter) Reads the external property content on the specified comparison side during merge.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.
-
Field Details
-
TEMPLATE_SYMLINK_POSTFIX
Template symlink postfix- See Also:
-
-
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 benullsession- the comparison session, cannot benullsymlinkPostfix- the symlink postfix, cannot benullisMerge-trueif run merge using external tool, andfalseif start comparisonrunAutoMerge-trueif needed to run automatic merge,falseotherwisemergeResultFile- the file to store merge result, can benullonly if isMerge isfalsemainComparisonSideName- the main comparison side name, cannot benullotherComparisonSideName- the other comparison side name, cannot benullexternalMergeToolProvider- the external merge tool provider, cannot benullsymbolicLinkLocalizer- the symbolic link localizer, cannot benullfilePathConverter- the file path converter, cannot benull- 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 benullmainStream- the main stream to process, cannot benullotherStream- the other stream to process, cannot benullancestorStream- the ancestor stream to process, may benullmergeResultFile- the file to store merge result, can benullonly if isMerge isfalsemainTitle- the main title, cannot benullotherTitle- the other title, cannot benullancestorTitle- the ancestor title, cannot benullisMerge-trueif run merge using external tool, andfalseif start comparisonrunAutoMerge-trueif needed to run automatic merge,falseotherwiseisThreeWay-trueif is three way comparison/merge,falseotherwise- 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 benullmergeSession- the merge session, cannot benullside- the comparison side to read content on, cannot benullfilePathConverter- the file path converter, cannot benull- 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 benullsession- the comparison session, cannot benullside- the comparison side to get content stream on, cannot benullfilePathConverter- the file path converter, cannot benull- Returns:
- the content stream or
nullif 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 benullmergeSession- the merge session, cannot benullside- the comparison side to get content stream on, cannot benullfilePathConverter- the file path converter, cannot benull- Returns:
- the content stream or
nullif 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 benullside- the side from which path must be retrieved, cannot benullfilePathConverter- the file path converter, cannot benull- 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 eitherTEXT_DOCUMENT_TEMPLATEor null.- Parameters:
node- external property node to check possibility to open manual merge editor, cannot benullsession- the comparison session, cannot benull- Returns:
trueif editor can be opened,falseotherwise
-
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 eitherTEXT_DOCUMENT_TEMPLATEor null.- Parameters:
node- solid resource comparison node to check, cannot benullsession- the comparison session, cannot benull- Returns:
trueif template is a text document,falseotherwise
-