remotePassword.setName("remotePassword");
remotePassword.setFieldLabel(Messages.get("label.remotePassword", "Remote password"));
remotePassword.setAllowBlank(false);
add(remotePassword);
final CronField schedule = new CronField();
schedule.setName("schedule");
schedule.setFieldLabel(Messages.get("label.remoteSchedule", "Schedule"));
add(schedule);
final CheckBox doValidate = new CheckBox();
doValidate.setFieldLabel(Messages.get("label.remoteValidate", "Test settings"));
doValidate.setValue(Boolean.TRUE);
add(doValidate);
// save properties button
Button saveButton = new Button(Messages.get("label.save", "Save"));
saveButton.addSelectionListener(new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent componentEvent) {
Map<String, String> props = new HashMap<String, String>();
props.put("remoteUrl", remoteUrlField.getValue());
props.put("remotePath", remotePath.getValue());
props.put("remoteUser", remoteUser.getValue());
props.put("remotePassword", remotePassword.getValue());
props.put("node", localPath.getValue().getUUID());
props.put("schedule", schedule.getValue());
JahiaContentManagementService.App.getInstance().createRemotePublication(nameField.getValue(), props, doValidate.getValue(), new BaseAsyncCallback<Boolean>() {
public void onSuccess(Boolean result) {
if (getParent() instanceof Window) {
((Window) getParent()).hide();