as it was proposed in there i am trying to implement new handler for export and import of members.
As an example i've taken built-in MemberTypeHandler. As far as i can see my job here is to develop proper serializer for this umbraco type and here where i stuck.
1) I am deriving my serializer from ISyncSerializerTwoPass
2) As far as i understand i must "assemble" complete object before it goes further in pipeline in Deserialize method. But how can i set MemberGroups for it inside serializer so that it will be properly added in system?
Glad your having a go at this, and i am happy to answer any quesitons it might throw up :)
Looking at the way the membership service is structured it might make sense to also have a MemberGroup Handler/Service that creates the groups and puts the members in them.
like a member handler This would need to attached to the membersave, etc to make sure it captured the group info, but it would probably result in cleaner code as it will match the services better.
Lets say i am looking on Jumoo.uSync.Core.Serializers.MemberTypeSerializer
as i can see there new object is created from xml to go further on pipeline.
I am creating such serializer for members.
How can set role to member object during deserialization which doesn't exist in database ?
or decouple the roles from the members have a Member Group Handler that runs after the member handler (so the members will be in the db) to add/remove members from groups.
Hi Kevin.
I m sorry it seems i didn't get your point. I was looking though code of existing handlers and serializers and tried to create something equal for members.
Please take a look on classes below especially at serializer class. Do i do it correct? If yes then how can how can i accomplish next aims:
1) //TODO: How to change MemberType if current one is incorrect?
2) //TODO: How to set/change membergroups for existing member and for new which is not being persisted in serializer!?
Implementing ISyncHandler for Members
Hi!
So, after seeing this topic: https://our.umbraco.org/projects/developer-tools/usync/usync/74139-are-there-any-plans-to-exportsync-members
as it was proposed in there i am trying to implement new handler for export and import of members.
As an example i've taken built-in MemberTypeHandler. As far as i can see my job here is to develop proper serializer for this umbraco type and here where i stuck.
1) I am deriving my serializer from ISyncSerializerTwoPass
2) As far as i understand i must "assemble" complete object before it goes further in pipeline in Deserialize method. But how can i set MemberGroups for it inside serializer so that it will be properly added in system?
Than you in advance for attention and help!
Hi
Glad your having a go at this, and i am happy to answer any quesitons it might throw up :)
Looking at the way the membership service is structured it might make sense to also have a MemberGroup Handler/Service that creates the groups and puts the members in them.
like a member handler This would need to attached to the membersave, etc to make sure it captured the group info, but it would probably result in cleaner code as it will match the services better.
Sorry didnt quite catch you.
Lets say i am looking on Jumoo.uSync.Core.Serializers.MemberTypeSerializer as i can see there new object is created from xml to go further on pipeline.
I am creating such serializer for members. How can set role to member object during deserialization which doesn't exist in database ?
Hi,
yeah you will need to create the roles - either during the deserialization of the member - if the role doesn't exist create it using the MemberGroup Service https://our.umbraco.org/documentation/Reference/Management/Services/MemberGroupService
or decouple the roles from the members have a Member Group Handler that runs after the member handler (so the members will be in the db) to add/remove members from groups.
Hi Kevin. I m sorry it seems i didn't get your point. I was looking though code of existing handlers and serializers and tried to create something equal for members.
Please take a look on classes below especially at serializer class. Do i do it correct? If yes then how can how can i accomplish next aims:
1) //TODO: How to change MemberType if current one is incorrect? 2) //TODO: How to set/change membergroups for existing member and for new which is not being persisted in serializer!?
is working on a reply...