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:
info.magnolia.cms.servlets.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: ExportPage.java 32667 2010-03-13 00:37:06Z gjoseph $
Author:
Fabrizio Giustina

Field Summary
protected  boolean mgnlKeepVersions
           
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  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()
           
 String getExt()
          Getter for ext.
 info.magnolia.cms.i18n.Messages getMessages()
           
 String getMgnlPath()
          Getter for mgnlPath.
 String getMgnlRepository()
          Getter for mgnlRepository.
 Iterator getRepositories()
           
 boolean isExportxml()
          Getter for exportxml.
 boolean isMgnlFormat()
          Getter for mgnlFormat.
 boolean isMgnlKeepVersions()
          Getter for mgnlKeepVersions.
 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 setMgnlKeepVersions(boolean mgnlKeepVersions)
          Setter for mgnlKeepVersions.
 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

mgnlKeepVersions

protected boolean mgnlKeepVersions
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.

isMgnlKeepVersions

public boolean isMgnlKeepVersions()
Getter for mgnlKeepVersions.

Returns:
Returns the mgnlKeepVersions.

setMgnlKeepVersions

public void setMgnlKeepVersions(boolean mgnlKeepVersions)
Setter for mgnlKeepVersions.

Parameters:
mgnlKeepVersions - The mgnlKeepVersions 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()
Specified by:
getCommand in interface info.magnolia.cms.servlets.MVCServletHandler
Overrides:
getCommand in class info.magnolia.cms.servlets.MVCServletHandlerImpl
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 info.magnolia.cms.servlets.MVCServletHandler
Overrides:
renderHtml in class TemplatedMVCHandler
Throws:
IOException

getMessages

public info.magnolia.cms.i18n.Messages getMessages()

getRepositories

public Iterator getRepositories()


Copyright © 2003-2010 Magnolia International Ltd.. All Rights Reserved.