com.poscoict.glueframework.web.control.spring.view
Class GlueJExcelView

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.view.AbstractView
              extended by org.springframework.web.servlet.view.document.AbstractJExcelView
                  extended by com.poscoict.glueframework.web.control.spring.view.GlueJExcelView
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.View

public class GlueJExcelView
extends org.springframework.web.servlet.view.document.AbstractJExcelView

JExcel ±â¹ÝÀ¸·Î ExcelÀ» ExportÇϱâ À§ÇÑ View ClassÀÌ´Ù.


Nested Class Summary
 class GlueJExcelView.JExcelFormat
          JExcelÀÇ Cell Type¿¡ ´ëÇÑ Á¤ÀǸ¦ °¡Áø ClassÀÌ´Ù.
 
Field Summary
static String DEFAULT_DATE_FORMAT
           
 
Fields inherited from class org.springframework.web.servlet.view.AbstractView
DEFAULT_CONTENT_TYPE
 
Fields inherited from interface org.springframework.web.servlet.View
PATH_VARIABLES, RESPONSE_STATUS_ATTRIBUTE, SELECTED_CONTENT_TYPE
 
Constructor Summary
GlueJExcelView()
           
 
Method Summary
protected  void buildExcelDocument(Map<String,Object> model, jxl.write.WritableWorkbook workbook, HttpServletRequest request, HttpServletResponse response)
           
protected  String[] getColumnIds(GlueContext ctx, String sheetId)
          GlueContext¿¡¼­ Column Id¸¦ °¡Á®¿À´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  String getFileName(GlueContext ctx)
          ¼³Á¤ °ª¿¡ µû¶ó FileNameÀ» ¸¸µé¾î ReturnÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  void writeBody(jxl.write.WritableSheet sheet, List<Map<String,Object>> list, String[] columnIds)
          Excel DataºÎ¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  void writeCell(jxl.write.WritableSheet sheet, int x, int y, Object data, String comment)
          ÇÑ CellÀ» WriteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  void writeHeader(jxl.write.WritableSheet sheet, String[] columnIds, String[] columnNames)
          Excel Header¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  void writeImage()
          ÇÊ¿ä ½Ã ±¸Çö.
protected  void writeRow(jxl.write.WritableSheet sheet, Map<String,Object> map, String[] columnIds, int y)
          Excel¿¡ ÇϳªÀÇ Row¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
protected  void writeSheet(GlueContext ctx, jxl.write.WritableSheet sheet, String sheetId)
          GlueContext¿¡ SheetId·Î ÁöÁ¤ÇÑ °´Ã¼À» GetÇÏ¿© Excel Sheet¸¦ WriteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.
 
Methods inherited from class org.springframework.web.servlet.view.document.AbstractJExcelView
generatesDownloadContent, getTemplateSource, renderMergedOutputModel, setUrl
 
Methods inherited from class org.springframework.web.servlet.view.AbstractView
addStaticAttribute, createMergedOutputModel, createRequestContext, createTemporaryOutputStream, exposeModelAsRequestAttributes, getAttributesMap, getBeanName, getContentType, getRequestContextAttribute, getStaticAttributes, isExposePathVariables, prepareResponse, render, setAttributes, setAttributesCSV, setAttributesMap, setBeanName, setContentType, setExposePathVariables, setRequestContextAttribute, setResponseContentType, toString, writeToResponse
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DATE_FORMAT

public static String DEFAULT_DATE_FORMAT
Constructor Detail

GlueJExcelView

public GlueJExcelView()
Method Detail

buildExcelDocument

protected void buildExcelDocument(Map<String,Object> model,
                                  jxl.write.WritableWorkbook workbook,
                                  HttpServletRequest request,
                                  HttpServletResponse response)
                           throws Exception
Specified by:
buildExcelDocument in class org.springframework.web.servlet.view.document.AbstractJExcelView
Throws:
Exception

getFileName

protected String getFileName(GlueContext ctx)
¼³Á¤ °ª¿¡ µû¶ó FileNameÀ» ¸¸µé¾î ReturnÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
ctx - GlueContext °´Ã¼
Returns:
String fileName

writeSheet

protected void writeSheet(GlueContext ctx,
                          jxl.write.WritableSheet sheet,
                          String sheetId)
                   throws Exception
GlueContext¿¡ SheetId·Î ÁöÁ¤ÇÑ °´Ã¼À» GetÇÏ¿© Excel Sheet¸¦ WriteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
ctx - GlueContext °´Ã¼
sheet - WritableSheet °´Ã¼
sheetId - Sheet Id·Î ExportÇÏ·Á´Â DataÀÇ Key
Throws:
Exception

getColumnIds

protected String[] getColumnIds(GlueContext ctx,
                                String sheetId)
GlueContext¿¡¼­ Column Id¸¦ °¡Á®¿À´Â ¸Þ¼ÒµåÀÌ´Ù. GlueContext¿¡ ¼³Á¤µÈ °ªÀÌ ¾ø´Â °æ¿ì RowSet ColumnDef¿¡¼­ Column Id Á¤º¸¸¦ °¡Á®¿Â´Ù.

Parameters:
ctx - GlueContext °´Ã¼
sheetId - ExcelÀÇ
Returns:
String[] Column Á¤º¸¿¡ ´ëÇÑ String¹è¿­

writeHeader

protected void writeHeader(jxl.write.WritableSheet sheet,
                           String[] columnIds,
                           String[] columnNames)
                    throws Exception
Excel Header¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
sheet - WritableSheet °´Ã¼
columnIds - Column Id¿¡ ´ëÇÑ String[]
columnNames - Column¸í¿¡ ´ëÇÑ String[]
Throws:
Exception

writeBody

protected void writeBody(jxl.write.WritableSheet sheet,
                         List<Map<String,Object>> list,
                         String[] columnIds)
                  throws Exception
Excel DataºÎ¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
sheet - WritableSheet °´Ã¼
list - Excel¿¡ WriteÇÏ·Á´Â Data °´Ã¼
columnIds - Column Id¿¡ ´ëÇÑ String[]
Throws:
Exception

writeRow

protected void writeRow(jxl.write.WritableSheet sheet,
                        Map<String,Object> map,
                        String[] columnIds,
                        int y)
                 throws Exception
Excel¿¡ ÇϳªÀÇ Row¸¦ ÀÛ¼ºÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
sheet - WritableSheet °´Ã¼
map - WriteÇÏ·Á´Â Data Map.
columnIds - Column Id¿¡ ´ëÇÑ String[]
y - writeÇÏ·Á´Â Line.
Throws:
Exception

writeCell

protected void writeCell(jxl.write.WritableSheet sheet,
                         int x,
                         int y,
                         Object data,
                         String comment)
                  throws Exception
ÇÑ CellÀ» WriteÇÏ´Â ¸Þ¼ÒµåÀÌ´Ù.

Parameters:
sheet - WritableSheet °´Ã¼
x - cellÀÇ x ÁÂÇ¥ À§Ä¡
y - cellÀÇ y ÁÂÇ¥ À§Ä¡
data - cell¿¡ Ç¥±âÇÏ·Á´Â ³»¿ë
comment - Column Id·Î nullÀÌ ¾Æ´Ñ °æ¿ì Comment(¸Þ¸ð)·Î »ðÀԵȴÙ.
Throws:
Exception

writeImage

protected void writeImage()
ÇÊ¿ä ½Ã ±¸Çö.



Copyright © 2013–2015 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.