com.poscoict.glueframework.biz.activity
Class GlueExcelInfo
java.lang.Object
com.poscoict.glueframework.biz.activity.GlueActivity<GlueContext>
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
==> 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
- Çʼö Ç׸ñ¸¸ ÁöÁ¤ÇÑ °æ¿ì
==> 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
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 |
GlueExcelInfo
public GlueExcelInfo()
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 ÇÑ´Ù.
¿¹)
==> return "success"À̸é BizLogic Activity ¸¦ ½ÇÇàÇÔ.
Copyright © 2013–2018 POSCO ICT. All rights reserved.