@Override protected Date getRawValue(SnapshotModel snapshotModel) { return snapshotModel.getEntity().getCreationDate(); } }, constants.dateSnapshot(), "140px"); //$NON-NLS-1$
private String getCreateDateString(Snapshot snapshot) { if (snapshot.getType() == SnapshotType.ACTIVE) { return constants.currentSnapshotLabel(); } return fullDateTimeRenderer.render(snapshot.getCreationDate()); }
@Mapping(from = org.ovirt.engine.core.common.businessentities.Snapshot.class, to = Snapshot.class) public static Snapshot map(org.ovirt.engine.core.common.businessentities.Snapshot entity, Snapshot template) { Snapshot model = template != null ? template : new Snapshot(); model.setId(entity.getId().toString()); if (entity.getDescription() != null) { model.setDescription(entity.getDescription()); } if (entity.getCreationDate() != null) { model.setDate(DateMapper.map(entity.getCreationDate(), null)); } if (entity.getStatus() != null) { model.setSnapshotStatus(map(entity.getStatus(), null)); } if (entity.getType() != null) { model.setSnapshotType(map(entity.getType(), null)); } model.setPersistMemorystate(entity.containsMemory()); return model; }
_writer.writeElement("Type", snapshot.getType().name()); _writer.writeElement("Description", snapshot.getDescription()); _writer.writeElement("CreationDate", OvfParser.localDateToUtcDateString(snapshot.getCreationDate()));
private void remove() { if (getEntity() != null) { if (getWindow() != null) { return; } Snapshot snapshot = getSelectedItem(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().deleteSnapshotTitle()); model.setHelpTag(HelpTag.delete_snapshot); model.setHashName("delete_snapshot"); //$NON-NLS-1$ model.setMessage(ConstantsManager.getInstance() .getMessages() .areYouSureYouWantToDeleteSanpshot( DateTimeFormat.getFormat(DATE_FORMAT).format(snapshot.getCreationDate()), snapshot.getDescription())); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnRemove", this); //$NON-NLS-1$ model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); //$NON-NLS-1$ model.getCommands().add(tempVar2); } }
private void commit() { if (getEntity() != null) { if (getWindow() != null) { return; } Snapshot snapshot = getSelectedItem(); ConfirmationModel model = new ConfirmationModel(); setWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().commitSnapshotTitle()); model.setHelpTag(HelpTag.commit_snapshot); model.setHashName("commit_snapshot"); //$NON-NLS-1$ model.setMessage(ConstantsManager.getInstance() .getMessages() .areYouSureYouWantToCommitSnapshot( DateTimeFormat.getFormat(DATE_FORMAT).format(snapshot.getCreationDate()), snapshot.getDescription())); model.getCommands().add(UICommand.createDefaultOkUiCommand("OnCommit", this)); //$NON-NLS-1$ model.getCommands().add(UICommand.createCancelUiCommand("Cancel", this)); //$NON-NLS-1$ } }
@Override protected MapSqlParameterSource createFullParametersMapper(Snapshot entity) { return createIdParameterMapper(entity.getId()) .addValue("vm_id", entity.getVmId()) .addValue("snapshot_type", EnumUtils.nameOrNull(entity.getType())) .addValue("status", EnumUtils.nameOrNull(entity.getStatus())) .addValue("description", entity.getDescription()) .addValue("creation_date", entity.getCreationDate()) .addValue("app_list", entity.getAppList()) .addValue("vm_configuration", entity.getVmConfiguration()) .addValue("memory_dump_disk_id", entity.getMemoryDiskId()) .addValue("memory_metadata_disk_id", entity.getMetadataDiskId()) .addValue("vm_configuration_broken", entity.isVmConfigurationBroken()); }