Search in sources :

Example 21 with Strategy

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

the class BackupExport method exportFile.

/*
	 * ##################### File-Explorer
	 */
private void exportFile(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    List<FileItem> list = fileItemDao.get();
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    bindDate(registry, list);
    writeList(serializer, zos, "fileExplorerItems.xml", "fileExplorerItems", list);
    progressHolder.setProgress(65);
}
Also used : FileItem(org.apache.openmeetings.db.entity.file.FileItem) 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 22 with Strategy

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

the class BackupExport method exportCalendar.

/*
	 * ##################### Backup Calendars
	 */
private void exportCalendar(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    List<OmCalendar> list = calendarDao.get();
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    registry.bind(User.class, UserConverter.class);
    writeList(serializer, zos, "calendars.xml", "calendars", list);
    progressHolder.setProgress(22);
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) OmCalendar(org.apache.openmeetings.db.entity.calendar.OmCalendar) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Example 23 with Strategy

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

the class BackupExport method exportGroups.

/*
	 * ##################### Backup  Groups
	 */
private void exportGroups(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer ser = new Persister(strategy);
    List<Group> list = groupDao.get(0, Integer.MAX_VALUE);
    bindDate(registry, list);
    writeList(ser, zos, "organizations.xml", "organisations", list);
    progressHolder.setProgress(5);
}
Also used : Group(org.apache.openmeetings.db.entity.user.Group) 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 24 with Strategy

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

the class BackupExport method exportPrivateMsg.

/*
	 * ##################### Private Messages
	 */
private void exportPrivateMsg(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    List<PrivateMessage> list = privateMessageDao.get(0, Integer.MAX_VALUE);
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer serializer = new Persister(strategy);
    registry.bind(User.class, UserConverter.class);
    registry.bind(Room.class, RoomConverter.class);
    bindDate(registry, list, PrivateMessage::getInserted);
    writeList(serializer, zos, "privateMessages.xml", "privatemessages", list);
    progressHolder.setProgress(50);
}
Also used : RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) Strategy(org.simpleframework.xml.strategy.Strategy) RegistryStrategy(org.simpleframework.xml.convert.RegistryStrategy) PrivateMessage(org.apache.openmeetings.db.entity.user.PrivateMessage) Registry(org.simpleframework.xml.convert.Registry) Persister(org.simpleframework.xml.core.Persister) Serializer(org.simpleframework.xml.Serializer)

Example 25 with Strategy

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

the class BackupExport method exportUsers.

/*
	 * ##################### Backup Users
	 */
private void exportUsers(ZipOutputStream zos, ProgressHolder progressHolder) throws Exception {
    Registry registry = new Registry();
    Strategy strategy = new RegistryStrategy(registry);
    Serializer ser = new Persister(strategy);
    registry.bind(Group.class, GroupConverter.class);
    registry.bind(Salutation.class, SalutationConverter.class);
    List<User> list = userDao.getAllBackupUsers();
    bindDate(registry, list);
    writeList(ser, zos, "users.xml", "users", list);
    progressHolder.setProgress(10);
}
Also used : User(org.apache.openmeetings.db.entity.user.User) 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