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_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(); }
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) { 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(); }
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_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_updatePlugin() { final List<PluginDto> list = findUpdatedPlugins(); final PluginUpdater updater = getPluginUpdater(); for (final PluginDto dto : list) { updater.installPlugin(dto.getId(), dto.getVersion(), isExcludeSnapshot()); } setTransferredNotes(new Notes().add(new Note( "app.plugin.update.succeed"))); return "/plugin.notes.html"; }
public Object do_rename() { Page page = getPage(); if (page == null) { throw new PageNotFoundRuntimeException() .setPathname(getPathname()); } if (action_ != null) { return processRename(page); } if (names_ == null || names_.length == 0) { setTransferredNotes(new Notes().add(new Note( "app.note.property.namesIsEmpty"))); } enableTab(PageTab.NAME_PROPERTY); enableLocationBar(true); return "/property.rename.html"; }
public final Object do_execute() { if (names_ == null || names_.length == 0) { setNotes(new Notes().add(new Note( "app.note.childPages.namesIsEmpty"))); } else { Page page = getPage(); if (canParent(page) && names_ != null) { for (int i = 0; i < names_.length; i++) { Page target = page.getChild(names_[i]); if (target != null) { processPage(target); } } } postProcess(); } return getRedirection("/list-page.do" + getPathname()); }
public Object do_execute() { if (!User.TYPE.equals(getPage().getType())) { setNotes(new Notes().add(new Note( "app.error.editGroupOfUser.notUser", getPathname()))); return "/error.html"; } if ("POST".equalsIgnoreCase(getYmirRequest().getMethod())) { if (updateGroupOfUser()) { return getRedirection("/edit-groupOfUser.do" + getPathname()); } } return render(); }
public Object do_execute() { if (!Group.TYPE.equals(getPage().getType())) { setNotes(new Notes().add(new Note( "app.error.editUserOfGroup.notGroup", getPathname()))); return "/error.html"; } if ("POST".equalsIgnoreCase(getYmirRequest().getMethod())) { if (updateUserOfGroup()) { return getRedirection("/edit-userOfGroup.do" + getPathname()); } } return render(); }