com.poscoict.glueframework.biz.activity
Class GlueExcelInfo

java.lang.Object
  extended by com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
      extended by com.poscoict.glueframework.biz.activity.GlueExcelInfo

public class GlueExcelInfo
extends GlueActivity<GlueContext>

ExcelInfo Activity. Excel Download¿¡ ÇÊ¿äÇÑ Á¤º¸¸¦ SettingÇÏ´Â Activity ClassÀÌ´Ù. Property·Î ÁöÁ¤ÇÑ °ªÀ» GlueContext¿¡ PutÇÏ¿© ExcelView Class¿¡¼­ Excel Generate ½Ã »ç¿ëÇÑ´Ù.

 Activity Property
 
 - file-name : (¼±ÅÃ) GenerateÇÒ Excel File Name. 
                      Default°ª : Service Name
 
 - excel-type : (¼±ÅÃ) ExcelÀÇ VersionÀ¸·Î XSSF(Excel 2007 ÀÌ»ó ¹öÀü)¿Í HSSF(Excel 2003 ÀÌÇÏ ¹öÀü) µÎ °¡Áö ÁöÁ¤ °¡´ÉÇÏ´Ù. 
                      Default°ª : XSSF  
 
 - sheet-name : (¼±ÅÃ) Excel³» Sheet¸íÀ¸·Î Çϳª ÀÌ»ó ÁöÁ¤ ½Ã space ¾øÀÌ Delimiter [,]·Î ±¸ºÐÇÏ¿© ÀÔ·ÂÇÑ´Ù. 
                      Default°ª : ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é sheet-id¸¦ Sheet¸íÀ¸·Î »ç¿ëÇÑ´Ù.
 
 - sheet-id : (Çʼö) Sheet¿¡ Data¸¦ GenerateÇϱâ À§ÇÑ 
 
 - [sheet-id]-column-id : (¼±ÅÃ) ÇØ´ç Sheet¿¡ º¸¿©ÁÙ column id¸¦ ÁöÁ¤ÇÑ´Ù.
                          query¿¡¼­ 100ÀÇ columnÀ» Á¶È¸ÇÏ´õ¶óµµ column-id¿¡ ÁöÁ¤ÇÑ column¸¸ Excel·Î GenerateµÈ´Ù.
                          Default : ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é queryÀÇ columnÀ» ¸ðµÎ Generate.
 
 - [sheet-id]-column-name : (¼±ÅÃ) ÇØ´ç Sheet¿¡ º¸¿©ÁÙ column¸íÀ» ÁöÁ¤ÇÑ´Ù.
                          À§ÀÇ column-id property¿Í ¸ÅÇεǵµ·Ï ÀÔ·ÂÇØ¾ß ÇÑ´Ù.
                          Default : ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é column-id°ªÀ¸·Î Generate.
 
 - [sheet-id]-column-width : (¼±ÅÃ) ÇØ´ç Sheet¿¡ º¸¿©ÁÙ columnÀÇ width¸¦ ÁöÁ¤ÇÑ´Ù
                          À§ column-id property¿Í ¸ÅÇεǵµ·Ï ÀÔ·ÂÇÑ´Ù
                          Default : ÁöÁ¤ÇÏÁö ¾ÊÀ¸¸é Excel Default Width·Î GenerateµÈ´Ù.
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <activity name="¿¢¼¿Á¤º¸¼Â¾÷" class="com.poscoict.glueframework.biz.activity.GlueExcelInfo">
         <property name="file-name" value="emp.xls" />
         <property name="excel-type" value="HSSF" />
         <property name="sheet-name" value="»ç¿øÁ¤º¸,ºÎ¼­Á¤º¸" />
         <property name="sheet-id" value="emp,dept" />
         <property name="dept-column-id" value="deptno,dname" />
         <property name="dept-column-name" value="ºÎ¼­¹øÈ£,ºÎ¼­¸í" />
         <property name="dept-column-width" value="80,120" />
         <transition name="success" value="end" />
     </activity>
     ==> GlueContextÀÇ emp¿Í dept·Î ÀúÀåµÈ RowSet °´Ã¼¸¦ Excel·Î ExportÇÑ´Ù. 
         Excel File¸íÀº emp.xlsÀÌ°í 2003 ÀÌÇÏ ¹öÀüÀ¸·Î »ý¼ºµÈ´Ù. 
         Excel Sheet¸íÀº °¢°¢ [»ç¿øÁ¤º¸], [ºÎ¼­Á¤º¸]·Î ¸í¸íµÇ°í 
         [ºÎ¼­Á¤º¸] Sheet¿¡ º¸¿©ÁÙ columnÀº deptno¿Í [dname µÎ °³¸¸ º¸¿©ÁØ´Ù(Äõ¸®¿¡´Â deptno, dname, loc ¼¼ °³ÀÇ Ä÷³ÀÓ)
                      column¸íÀº °¢°¢ [ºÎ¼­¹øÈ£], [ºÎ¼­¸í]À¸·Î Ç¥±âÇϸç 
                      column width´Â 80, 120 Çȼ¿·Î ÁöÁ¤ÇÑ´Ù
         [»ç¿øÁ¤º¸] Sheet¿¡ º¸¿©ÁÙ columnÀº Query¿¡¼­ Á¶È¸ÇÑ Ä÷³À» ¸ðµÎ º¸¿©ÁÖ°í
                      column¸íÀº column id·Î Ç¥±âµÇ°í
                      column width´Â Excel Default width·Î ÁöÁ¤µÈ´Ù
 
 
 »ç¿ë ¿¹# 2
 - Çʼö Ç׸ñ¸¸ ÁöÁ¤ÇÑ °æ¿ì
 
     <activity name="¿¢¼¿Á¤º¸¼Â¾÷" class="com.poscoict.glueframework.biz.activity.GlueExcelInfo">
         <property name="sheet-id" value="emp,dept" />
         <transition name="success" value="end" />
     </activity>
     ==> GlueContextÀÇ emp¿Í dept·Î ÀúÀåµÈ RowSet °´Ã¼¸¦ Excel·Î ExportÇÑ´Ù.
         Excel File¸íÀº Service¸íÀ¸·Î ÁöÁ¤µÇ°í 
         Excel VersionÀº 2007 vesrionÀÎ xlsx·Î 
         Excel Sheet¸íÀº °¢°¢ emp, dept·Î 
         °¢ SheetÀÇ Column¸íÀº Äõ¸®¿¡ ÁöÁ¤µÈ Column Id·Î
         column width ¶ÇÇÑ ExcelÀÇ Default°ªÀ¸·Î ¼³Á¤µÈ´Ù.
 
 
 
 ExcelÀ» DownloadÇÏ´Â ½Ã³ª¸®¿À ¹× È帧Àº ¾Æ·¡¿Í °°´Ù.
  1. È­¸é¿¡¼­ »ç¿ëÀÚ°¡ ExportÇϱâ À§ÇÑ DataÀÇ Á¶°ÇÀ» ÀÔ·Â ÈÄ Export ¹öÆ° Ŭ¸¯
  2. Glue AD¿¡¼­ ExportÇÒ Data¸¦ Á¶È¸µÈ ÈÄ RowSet(List<Map<String, Object>>)ÇüÅ·ΠGlueContext¿¡ ÀúÀå
  3. GlueExcelInfo Activity(ÀÌ Activity)¿¡¼­ Excel·Î GenerateÇϱâ À§ÇÑ Á¤º¸¸¦ ÁöÁ¤
  4. Controller¿¡¼­ Á¶È¸ÇÑ Data¸¦ È­¸éÀ¸·Î º¸³»±â À§ÇÑ ModelAndView¿¡ View¸íÀ» ÁöÁ¤
  5. Controller¿¡¼­ ÁöÁ¤ÇÑ View°¡ ½ÇÇàµÇ¸ç GlueExcelInfo Activity¿¡¼­ ¼³Á¤ÇÑ °ªÀ» ¹ÙÅÁÀ¸·Î Excel Generate 
  
  ** Âü°í·Î À§ Flow¿¡¼­ GlueExcelInfo Activity¸¦ »ý·«ÇÒ ¼ö ÀÖ´Ù. 
     »ý·«ÇÒ °æ¿ì GlueExcelInfo¿¡¼­ ÁöÁ¤ÇÒ °ªÀ»  È­¸é¿¡¼­ Request Parameter·Î º¸³»¾ß ÇÑ´Ù
 
 


Field Summary
 
Fields inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
dynamicProperties, logger
 
Constructor Summary
GlueExcelInfo()
           
 
Method Summary
 String runActivity(GlueContext ctx)
          Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù.
 
Methods inherited from class com.poscoict.glueframework.biz.activity.GlueActivity
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueExcelInfo

public GlueExcelInfo()
Method Detail

runActivity

public String runActivity(GlueContext ctx)
Description copied from class: GlueActivity
Sub Class¿¡¼­ ¹Ýµå½Ã ±¸ÇöÇÏ¿©¾ß ÇÏ´Â Abstract Method À̸ç ÀÌ Method´Â F/W¿¡¼­ È£ÃâÇÑ´Ù. °á°ú °ªÀº GlueContext¿¡ ´ã¾Æ¼­ ´ÙÀ½ Activity ¶Ç´Â F/W¿¡ Àü´ÞÇÏ°Ô µÈ´Ù. ÇÊ¿äÇÑ ¸ðµç Data´Â GlueContext¿¡¼­ È£ÃâÇÏ¿© »ç¿ëÇÏ°Ô µÈ´Ù.

Specified by:
runActivity in class GlueActivity<GlueContext>
Parameters:
ctx - GlueContext
Returns:
String Á¤»óÀûÀ̸é "success"¸¦ Return ÇÏ°í ºñÁ¤»ó 󸮸¦ ¿øÇϸé "failure"¸¦ Return ÇÑ´Ù.
 ¿¹) 
 <transition name="success" value="BizLogic"/>
 <transition name="failure" value="ErrorHandle"/>
 ==> return "success"À̸é BizLogic Activity ¸¦ ½ÇÇàÇÔ.
 


Copyright © 2013–2018 POSCO ICT. All rights reserved.