Class MergeManager
java.lang.Object
org.broadleafcommerce.common.extensibility.context.merge.MergeManager
This class manages all xml merge interactions with callers. It is responsible for
not only loading the handler configurations, but also for cycling through the handlers
in a prioritized fashion and exporting the final merged document.
- Author:
- jfischer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Additional merge points may be added by the caller. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmerge
(ResourceInputStream stream1, ResourceInputStream stream2) Merge 2 xml document streams together into a final resulting stream.protected void
removeItemsMatchingKey
(String firstKey, Properties props) Removes all keys that share the same number.protected void
removeSkipMergeComponents
(Properties props, String componentName) Examines the properties file for an entry with an id equal to the component that we want to ignore and then removes all keys that have the same number (e.g. if xpath.28 is the key then handler.28, xpath.28, and priority.28 will all be removed).protected void
serialize
(InputStream in) protected void
setHandlers
(Properties props)
-
Field Details
-
MERGE_DEFINITION_SYSTEM_PROPERTY
Additional merge points may be added by the caller. Also default merge points may be overriden to change their current behavior. This is accomplished by specifying the system property denoted by the key MergeManager.MERGE_DEFINITION_SYSTEM_PROPERTY with a value stating the fully qualified path of user-created property file. Please refer to the default properties file located at org/broadleafcommerce/profile/extensibility/context/merge/default.properties for more details.- See Also:
-
-
Constructor Details
-
MergeManager
- Throws:
MergeManagerSetupException
-
-
Method Details
-
removeSkippedMergeComponents
- Throws:
UnsupportedEncodingException
-
removeSkipMergeComponents
Examines the properties file for an entry with an id equal to the component that we want to ignore and then removes all keys that have the same number (e.g. if xpath.28 is the key then handler.28, xpath.28, and priority.28 will all be removed).- Parameters:
props
-componentName
-
-
removeItemsMatchingKey
Removes all keys that share the same number. (e.g. if xpath.28 is the key then handler.28, xpath.28, and priority.28 will all be removed).- Parameters:
firstKey
-props
-
-
merge
public ResourceInputStream merge(ResourceInputStream stream1, ResourceInputStream stream2) throws MergeException Merge 2 xml document streams together into a final resulting stream. During the merge, various merge business rules are followed based on configuration defined for various merge points.- Parameters:
stream1
-stream2
-- Returns:
- the stream representing the merged document
- Throws:
MergeException
-
setHandlers
protected void setHandlers(Properties props) throws ClassNotFoundException, IllegalAccessException, InstantiationException -
serialize
-