info.magnolia.module.admininterface.pages
Class ExportPage

java.lang.Object
  extended by info.magnolia.cms.servlets.MVCServletHandlerImpl
      extended by info.magnolia.cms.servlets.CommandBasedMVCServletHandler
          extended by info.magnolia.module.admininterface.PageMVCHandler
              extended by info.magnolia.module.admininterface.TemplatedMVCHandler
                  extended by info.magnolia.module.admininterface.pages.ExportPage
All Implemented Interfaces:
MVCServletHandler
Direct Known Subclasses:
ImportPage

public class ExportPage
extends TemplatedMVCHandler

Simple servlet used to import/export data from jcr using the standard jcr import/export features.

Version:
$Id$
Author:
Fabrizio Giustina

Field Summary
protected  String mgnlPath
           
protected  String mgnlRepository
           
static String MIME_APPLICATION_ZIP
           
static String MIME_GZIP
           
static String MIME_TEXT_XML
           
static long serialVersionUID
          Stable serialVersionUID.
static String VIEW_EXPORT
          View value for the export file stream (won't render anything)
 
Fields inherited from class info.magnolia.module.admininterface.PageMVCHandler
COMMAND_PARAMETER_NAME, COMMAND_SHOW, VIEW_SHOW
 
Fields inherited from class info.magnolia.cms.servlets.MVCServletHandlerImpl
exception, request, response, VIEW_ERROR, VIEW_SUCCESS
 
Fields inherited from interface info.magnolia.cms.servlets.MVCServletHandler
VIEW_NOTHING
 
Constructor Summary
ExportPage(String name, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
protected  void checkPath()
           
protected  boolean checkPermissions(javax.servlet.http.HttpServletRequest request, String repository, String basePath, long permissionType)
          Uses access manager to authorise this request.
 String exportxml()
          Actually perform export.
 String getCommand()
          Returns the name of the command we want to execute.
 String getExt()
          Getter for ext.
 Messages getMessages()
           
 String getMgnlPath()
          Getter for mgnlPath.
 String getMgnlRepository()
          Getter for mgnlRepository.
 Iterator getRepositories()
           
 boolean isExportxml()
          Getter for exportxml.
 boolean isMgnlFormat()
          Getter for mgnlFormat.
 void renderHtml(String view)
          Renders the template.
 void setExportxml(boolean exportxml)
          Setter for exportxml.
 void setExt(String ext)
          Setter for ext.
 void setMgnlFormat(boolean mgnlFormat)
          Setter for mgnlFormat.
 void setMgnlPath(String mgnlPath)
          Setter for mgnlPath.
 void setMgnlRepository(String mgnlRepository)
          Setter for mgnlRepository.
 
Methods inherited from class info.magnolia.module.admininterface.TemplatedMVCHandler
getTemplateName
 
Methods inherited from class info.magnolia.module.admininterface.PageMVCHandler
getForm, getI18nBasename, getMsgs, getParams, init, setForm, setI18nBasename, setMsgs, setParams, show
 
Methods inherited from class info.magnolia.cms.servlets.CommandBasedMVCServletHandler
execute, findCommand, getCatalogueName, getCommandContext, getViewNameAfterExecution, setCatalogueName
 
Methods inherited from class info.magnolia.cms.servlets.MVCServletHandlerImpl
getException, getExceptionStackTrace, getName, getRequest, getResponse, populateFromRequest, setCommand, setRequest, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Stable serialVersionUID.

See Also:
Constant Field Values

MIME_TEXT_XML

public static final String MIME_TEXT_XML
See Also:
Constant Field Values

MIME_GZIP

public static final String MIME_GZIP
See Also:
Constant Field Values

MIME_APPLICATION_ZIP

public static final String MIME_APPLICATION_ZIP
See Also:
Constant Field Values

VIEW_EXPORT

public static final String VIEW_EXPORT
View value for the export file stream (won't render anything)

See Also:
Constant Field Values

mgnlRepository

protected String mgnlRepository

mgnlPath

protected String mgnlPath
Constructor Detail

ExportPage

public ExportPage(String name,
                  javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
Parameters:
name -
request -
response -
Method Detail

getExt

public String getExt()
Getter for ext.

Returns:
Returns the ext.

setExt

public void setExt(String ext)
Setter for ext.

Parameters:
ext - The ext to set.

isMgnlFormat

public boolean isMgnlFormat()
Getter for mgnlFormat.

Returns:
Returns the mgnlFormat.

setMgnlFormat

public void setMgnlFormat(boolean mgnlFormat)
Setter for mgnlFormat.

Parameters:
mgnlFormat - The mgnlFormat to set.

getMgnlPath

public String getMgnlPath()
Getter for mgnlPath.

Returns:
Returns the mgnlPath.

setMgnlPath

public void setMgnlPath(String mgnlPath)
Setter for mgnlPath.

Parameters:
mgnlPath - The mgnlPath to set.

getMgnlRepository

public String getMgnlRepository()
Getter for mgnlRepository.

Returns:
Returns the mgnlRepository.

setMgnlRepository

public void setMgnlRepository(String mgnlRepository)
Setter for mgnlRepository.

Parameters:
mgnlRepository - The mgnlRepository to set.

isExportxml

public boolean isExportxml()
Getter for exportxml.

Returns:
Returns the exportxml.

setExportxml

public void setExportxml(boolean exportxml)
Setter for exportxml.

Parameters:
exportxml - The exportxml to set.

getCommand

public String getCommand()
Description copied from interface: MVCServletHandler
Returns the name of the command we want to execute.

Specified by:
getCommand in interface MVCServletHandler
Overrides:
getCommand in class MVCServletHandlerImpl
Returns:
Returns the command.
See Also:
MVCServletHandlerImpl.getCommand()

exportxml

public String exportxml()
                 throws Exception
Actually perform export. The generated file is sent to the client.

Parameters:
response - HttpServletResponse
repository - selected repository
basepath - base path in repository
format - should we format the resulting xml
keepVersionHistory - if false version info will be stripped from the exported document
Throws:
IOException - for errors while accessing the servlet output stream
Exception

checkPermissions

protected boolean checkPermissions(javax.servlet.http.HttpServletRequest request,
                                   String repository,
                                   String basePath,
                                   long permissionType)
Uses access manager to authorise this request.

Parameters:
request - HttpServletRequest as received by the service method
Returns:
boolean true if read access is granted

renderHtml

public void renderHtml(String view)
                throws IOException
Description copied from class: TemplatedMVCHandler
Renders the template. The handlers is passed with the name 'this'.

Specified by:
renderHtml in interface MVCServletHandler
Overrides:
renderHtml in class TemplatedMVCHandler
Throws:
IOException

getMessages

public Messages getMessages()

getRepositories

public Iterator getRepositories()

checkPath

protected void checkPath()
                  throws javax.jcr.LoginException,
                         javax.jcr.RepositoryException,
                         javax.servlet.ServletException
Throws:
javax.jcr.LoginException
javax.jcr.RepositoryException
javax.servlet.ServletException


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.