incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fabian Sergio de Rosa" <>
Subject Edit and update page from a plugin.
Date Tue, 24 Jun 2008 17:12:46 GMT
I´m trying to update a page content from a plugin, but nothing is happen and
no error is showed in the logfile.
I can´t find doc about how to do that. If anyone know a example that really
works please send me.

This is my code:
    public String execute(WikiContext context, Map parameters) throws
PluginException {
        WikiEngine engine = context.getEngine();
        String menuTreeText = engine.getText("MenuTree");"MenuTree antes "+menuTreeText);"Matchea el texto ? " +
        menuTreeText = menuTreeText.replace("["+ambiente+"|"+ambiente+"]",
        savePage(context, "MenuTree", menuTreeText);

//Thats the method that save a page, but nothing.
    private void savePage(WikiContext context, String pageName, String text)
throws PluginException {
        WikiPage newPage = new WikiPage(context.getEngine(), pageName);
        WikiContext newContext = (WikiContext) context.clone();
        try {
            context.getEngine().saveText(newContext, text);
        } catch (WikiException e) {
            throw new PluginException("Error al guardar ",e);

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message