Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialize different presets #10

Closed
studert opened this issue Jan 13, 2014 · 2 comments
Closed

Serialize different presets #10

studert opened this issue Jan 13, 2014 · 2 comments

Comments

@studert
Copy link

studert commented Jan 13, 2014

I see in your code that you support deserialization of named presets through a query string parameter (in the sync tool), but the serialization part on the events only seems to consider the default preset. Am I missing something? Thank you very much for your answer, there will be follow up questions ;)

@kamsar
Copy link
Collaborator

kamsar commented Jan 14, 2014

You are not missing anything; the currently released version of Unicorn does not provide any way to hook the event handlers to a non-default preset.

However, if you take a peep at Unicorn 2 (presently alpha-quality) it's resolved there:

In Unicorn 2 you install a data provider instead of event handlers (this gets around EventDisablers). The core data provider has a constructor that takes a params array of UnicornDataProvider:
https://github.com/kamsar/Unicorn/blob/extensibility/src/Unicorn/UnicornSqlServerDataProvider.cs

The UnicornDataProvider is a unit of serialization - e.g. one preset. So you can hitch 1...n presets into a single UnicornSqlServerDataProvider instance. And by 'presets' I mean IPredicate implementations, where SerializationPresetPredicate is merely one of the possible implementations that can be dreamed up :)
https://github.com/kamsar/Unicorn/blob/extensibility/src/Unicorn/UnicornDataProvider.cs

@studert
Copy link
Author

studert commented Jan 19, 2014

Thank you very much for your answer. I am in the process of writing a module for Sitecore and I am trying out how Unicorn can support me in the process. What I would like to do is having multiple presets serializing to different folders. This way I could specify a preset only defining the items relevant to the module and writing them to a seperate folder. From there, the build server could pick them up and automatically pack them into a Sitecore NuGet Package.

So far, it's just an idea. But I'm really looking forward to see what's coming with Unicorn 2 :)

@studert studert closed this as completed Jan 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants