com.xpn.xwiki.web
Class SaveAction

java.lang.Object
  extended by org.apache.struts.action.Action
      extended by com.xpn.xwiki.web.XWikiAction
          extended by com.xpn.xwiki.web.EditAction
              extended by com.xpn.xwiki.web.PreviewAction
                  extended by com.xpn.xwiki.web.SaveAction

public class SaveAction
extends PreviewAction

Action used for saving and proceeding to view the saved page.

Used as a generic action for saving documents.

Version:
$Id: 009ac218a2a771e6a71c0609c4f33c213d0e73ff $

Field Summary
static String ACTION_NAME
          The identifier of the save action.
 
Fields inherited from class org.apache.struts.action.Action
servlet
 
Constructor Summary
SaveAction()
           
 
Method Summary
 boolean action(XWikiContext context)
           
 String render(XWikiContext context)
           
 boolean save(XWikiContext context)
          Saves the current document, updated according to the parameters sent in the request.
 
Methods inherited from class com.xpn.xwiki.web.EditAction
prepareEditedDocument
 
Methods inherited from class com.xpn.xwiki.web.XWikiAction
cleanupComponents, csrfTokenCheck, execute, execute, getRealPath, getTranslatedDocument, handleRevision, initializeContainerComponent, initializeXWikiContext, sendGlobalRedirect, sendRedirect
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_NAME

public static final String ACTION_NAME
The identifier of the save action.

See Also:
Constant Field Values
Constructor Detail

SaveAction

public SaveAction()
Method Detail

save

public boolean save(XWikiContext context)
             throws XWikiException
Saves the current document, updated according to the parameters sent in the request.

Parameters:
context - The current request context.
Returns:
true if there was an error and the response needs to render an error page, false if the document was correctly saved.
Throws:
XWikiException - If an error occured: cannot communicate with the storage module, or cannot update the document because the request contains invalid parameters.

action

public boolean action(XWikiContext context)
               throws XWikiException
Overrides:
action in class PreviewAction
Throws:
XWikiException

render

public String render(XWikiContext context)
              throws XWikiException
Overrides:
render in class PreviewAction
Throws:
XWikiException


Copyright © 2004–2014 XWiki. All rights reserved.