protected void processPage(Page page, Notes notes) { String name = page.getName(); try { page.moveTo(getPage(), name); } catch (DuplicatePageException ex) { notes.add(new Note("app.error.movePage.nameAlreadyExists", name)); } catch (LoopDetectedException ex) { notes.add(new Note("app.error.movePage.loopDetected", page .getPathname())); } }
protected void processPage(Page page, Notes notes) { String name = page.getName(); try { pagePlugin_.copy(getPage(), name, page, true); } catch (DuplicatePageException ex) { throw new RuntimeException("Can't happen!", ex); } catch (LoopDetectedException ex) { notes.add(new Note("app.error.copyPage.loopDetected", page .getPathname())); } }
public Object do_deleteVariant() { if (!variant_.equals(Page.VARIANT_DEFAULT)) { deleteVariant(variant_); setNotes(new Notes().add(new Note( "app.note.property.deleteVariant.succeed", variant_))); } updateMenu(); Map<String, String[]> paramMap = new HashMap<String, String[]>(); paramMap.put("variant", new String[] { Page.VARIANT_DEFAULT }); return getRedirection("/property.list.do" + getPathname(), paramMap); }
public Object do_delete() { do { if (names_ == null || names_.length == 0) { setNotes(new Notes().add(new Note( "app.error.clipboard.namesIsEmpty"))); break; } Clipboard clipboard = getClipboard(); for (int i = 0; i < names_.length; i++) { clipboard.removeEntry(names_[i]); } setNotes(new Notes().add(new Note( "app.note.clipboard.deletedFromClipboard"))); } while (false); return do_execute(); }
private boolean createProperty() { PropertyAbility prop = (PropertyAbility)getPage().getAbility( PropertyAbility.class); if (name_.length() == 0) { setNotes(new Notes().add(new Note( "app.note.property.new.nameIsEmpty"))); return false; } if (prop.containsPropertyName(name_)) { setNotes(new Notes().add(new Note( "app.note.property.new.alreadyExists", name_))); return false; } prop.setProperty(name_, value_); getPage().touch(); setNotes(new Notes().add(new Note("app.note.property.new.succeed"))); return true; }
public Object do_delete() { if (names_ == null || names_.length == 0) { setNotes(new Notes() .add(new Note("app.note.property.namesIsEmpty"))); } else { PropertyAbility prop = (PropertyAbility)getPage().getAbility( PropertyAbility.class); for (int i = 0; i < names_.length; i++) { prop.removeProperty(names_[i], variant_); } setNotes(new Notes().add(new Note( "app.note.property.delete.succeed"))); updateMenu(); } return do_list(); }
public Object do_execute() { if ("POST".equalsIgnoreCase(getYmirRequest().getMethod())) { if (updateTemplate()) { setNotes(new Notes().add(new Note( "app.note.editTemplate.succeed"))); Map<String, String[]> paramMap = new HashMap<String, String[]>(); paramMap.put("variant", new String[] { variant_ }); return getRedirection("/edit-template.do" + getPathname(), paramMap); } } return render(); }
public Object do_execute() { if ("POST".equalsIgnoreCase(getYmirRequest().getMethod())) { try { updateContent(); setNotes(new Notes().add(new Note( "app.note.editContent.succeed"))); Map<String, String[]> paramMap = new HashMap<String, String[]>(); paramMap.put("variant", new String[] { variant_ }); return getRedirection("/edit-content.do" + getPathname(), paramMap); } catch (IOException ex) { log_.warn("Can't read body file: " + body_, ex); setNotes(new Notes().add(new Note("app.error.generic", ex .toString()))); } } return render(); }
public Object do_edit() { if (names_ == null || names_.length == 0) { setTransferredNotes(new Notes().add(new Note( "app.note.property.namesIsEmpty"))); } enableTab(PageTab.NAME_PROPERTY); enableLocationBar(true); prepareDefinedVariants(); preparePropertyRows(names_ != null ? names_ : new String[0]); return "/property.edit.html"; }
public Object do_execute() { if (names_ == null || names_.length == 0) { setNotes(new Notes().add(new Note( "app.note.childPages.namesIsEmpty"))); } else { if (!commit_) { return render(); } Page page = getPage(); for (int i = 0; i < names_.length; i++) { update(page.getChild(names_[i])); } setNotes(new Notes().add(new Note("app.note.changePages.succeed"))); } return getRedirection("/list-page.do" + getPathname()); }
public Object do_execute() { if (names_ == null || names_.length == 0) { NamePair[] namePairs = getNamePairs(); if (namePairs.length > 0) { if (processRename(namePairs)) { setNotes(new Notes().add(new Note( "app.note.renamePage.succeed"))); updateMenu(); } } else { setNotes(new Notes().add(new Note( "app.note.childPages.namesIsEmpty"))); } return getRedirection("/list-page.do" + getPathname()); } return render(); }
boolean importPage() setNotes(new Notes().add(new Note( "app.error.importPage.nameIsEmpty"))); return false; setNotes(new Notes().add(new Note( "app.error.importPage.archiveIsEmpty"))); return false; } catch (IOException ex) { ex.printStackTrace(); setNotes(new Notes().add(new Note("app.error.importPage.failure", ThrowableUtils.getStackTraceString(ex)))); return false; } catch (DuplicatePageException ex) { setNotes(new Notes().add(new Note( "app.error.importPage.pageAlreadyExists"))); return false;
public String do_apply() { if (!canExecute()) { return "redirect:"; } if (password_ == null || password_.length() == 0) { // 空のパスワードは設定できないようにする。 setNotes(new Notes().add(new Note( "app.error.userService.passwordIsEmpty"))); return "/configure.html"; } authPlugin_.getDefaultAuthSystem().changePassword( getPageAlfr().getAdministrator(), password_); return "redirect:/configure.succeed.do"; }