automaticallySavedDraftIds.add(id);
}
}
// Preview for looking glass.
Preview preview = new Preview();
UUID currentPreviewId = user.getCurrentPreviewId();
if (currentPreviewId == null) {
saveUser = true;
currentPreviewId = preview.getId();
user.setCurrentPreviewId(currentPreviewId);
}
Map<String, Object> values = state.getSimpleValues();
preview.getState().setId(currentPreviewId);
preview.setCreateDate(new Date());
preview.setObjectType(state.getType());
preview.setObjectId(state.getId());
preview.setObjectValues(values);
preview.setSite(page.getSite());
preview.save();
AuthenticationFilter.Static.setCurrentPreview(page.getRequest(), page.getResponse(), preview);
user.saveAction(page.getRequest(), object);
if (saveUser) {
user.save();