Search in sources :

Example 1 with Strategy

use of org.simpleframework.xml.strategy.Strategy in project osm-contributor by jawg.

the class CommonSyncModule method getPersister.

@Provides
Persister getPersister() {
    RegistryMatcher matchers = new RegistryMatcher();
    matchers.bind(org.joda.time.DateTime.class, JodaTimeDateTimeTransform.class);
    Strategy strategy = new AnnotationStrategy();
    return new Persister(strategy, matchers);
}
Also used : AnnotationStrategy(org.simpleframework.xml.convert.AnnotationStrategy) AnnotationStrategy(org.simpleframework.xml.convert.AnnotationStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryMatcher(org.simpleframework.xml.transform.RegistryMatcher) Persister(org.simpleframework.xml.core.Persister) Provides(dagger.Provides)

Example 2 with Strategy

use of org.simpleframework.xml.strategy.Strategy in project openmeetings by apache.

the class BackupExport method exportRoomGroup.

/*
	 * ##################### Backup Room Groups
	 */
private void exportRoomGroup(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    registry.bind(Group.class, GroupConverter.class);
    registry.bind(Room.class, RoomConverter.class);
    writeList(serializer, zos, "rooms_organisation.xml", "room_organisations", roomDao.getGroups());
    progressHolder.setProgress(17);
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Example 3 with Strategy

use of org.simpleframework.xml.strategy.Strategy in project openmeetings by apache.

the class BackupExport method exportContacts.

/*
	 * ##################### User Contacts
	 */
private void exportContacts(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    registry.bind(User.class, UserConverter.class);
    writeList(serializer, zos, "userContacts.xml", "usercontacts", userContactDao.get());
    progressHolder.setProgress(60);
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Example 4 with Strategy

use of org.simpleframework.xml.strategy.Strategy in project openmeetings by apache.

the class BackupExport method exportMeetingMember.

/*
	 * ##################### Backup Meeting Members
	 */
private void exportMeetingMember(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    registry.bind(User.class, UserConverter.class);
    registry.bind(Appointment.class, AppointmentConverter.class);
    writeList(serializer, zos, "meetingmembers.xml", "meetingmembers", meetingMemberDao.getMeetingMembers());
    progressHolder.setProgress(30);
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Example 5 with Strategy

use of org.simpleframework.xml.strategy.Strategy in project openmeetings by apache.

the class BackupExport method getConfigSerializer.

private static Serializer getConfigSerializer(List<Configuration> list) throws Exception {
    Registry registry = new Registry();
    registry.bind(User.class, UserConverter.class);
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    bindDate(registry, list);
    return serializer;
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Aggregations

Persister (org.simpleframework.xml.core.Persister)34 Strategy (org.simpleframework.xml.strategy.Strategy)34 Registry (org.simpleframework.xml.convert.Registry)33 RegistryStrategy (org.simpleframework.xml.convert.RegistryStrategy)33 Serializer (org.simpleframework.xml.Serializer)31 UserConverter (org.apache.openmeetings.backup.converter.UserConverter)9 RegistryMatcher (org.simpleframework.xml.transform.RegistryMatcher)7 RoomConverter (org.apache.openmeetings.backup.converter.RoomConverter)5 Room (org.apache.openmeetings.db.entity.room.Room)4 FileItem (org.apache.openmeetings.db.entity.file.FileItem)3 IOException (java.io.IOException)2 GroupConverter (org.apache.openmeetings.backup.converter.GroupConverter)2 ChatMessage (org.apache.openmeetings.db.entity.basic.ChatMessage)2 Appointment (org.apache.openmeetings.db.entity.calendar.Appointment)2 OmCalendar (org.apache.openmeetings.db.entity.calendar.OmCalendar)2 BaseFileItem (org.apache.openmeetings.db.entity.file.BaseFileItem)2 Recording (org.apache.openmeetings.db.entity.record.Recording)2 RoomFile (org.apache.openmeetings.db.entity.room.RoomFile)2 RoomPoll (org.apache.openmeetings.db.entity.room.RoomPoll)2 PrivateMessage (org.apache.openmeetings.db.entity.user.PrivateMessage)2