untitled

Similar documents
untitled

untitled

untitled

untitled

untitled

untitled

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

untitled

자바-11장N'1-502

untitled

14-Servlet

PowerPoint 프레젠테이션

12-file.key

PowerPoint 프레젠테이션

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

rmi_박준용_final.PDF

02 C h a p t e r Java

<4D F736F F F696E74202D20C1A63234C0E520C0D4C3E2B7C228B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

신림프로그래머_클린코드.key

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]

JMF2_심빈구.PDF

Microsoft PowerPoint - 03-TCP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt

歯JavaExceptionHandling.PDF

FileMaker ODBC and JDBC Guide

untitled

PowerPoint 프레젠테이션

자바 프로그래밍

07 자바의 다양한 클래스.key

Interstage5 SOAP서비스 설정 가이드

JavaGeneralProgramming.PDF

<4D F736F F F696E74202D20C1A63235C0E520B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

04장

API STORE 키발급및 API 사용가이드 Document Information 문서명 : API STORE 언어별 Client 사용가이드작성자 : 작성일 : 업무영역 : 버전 : 1 st Draft. 서브시스템 : 문서번호 : 단계 : Docum

untitled

FileMaker ODBC and JDBC Guide

Chap12

05-class.key

13-Java Network Programming

untitled

비긴쿡-자바 00앞부속

NoSQL

교육자료

PWR PWR HDD HDD USB USB Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl Cable PC PC DDNS (

PowerPoint Presentation

J2EE Concepts

mytalk

슬라이드 1

untitled

PowerPoint Presentation

MasoJava4_Dongbin.PDF

untitled

Cluster management software

PowerPoint 프레젠테이션

Network seminar.key

thesis

1

09-interface.key

PowerPoint Presentation

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공

untitled

Java

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O

untitled

untitled

JMF3_심빈구.PDF

FileMaker 15 ODBC 및 JDBC 설명서

USB USB DV25 DV25 REC SRN-475S REC SRN-475S LAN POWER LAN POWER Quick Network Setup Guide xdsl/cable Modem PC DVR 1~3 1.. DVR DVR IP xdsl Cable xdsl C

Network Programming

Microsoft PowerPoint - 18-DataSource.ppt

쉽게 풀어쓴 C 프로그래밊

untitled

Java ...

JAVA PROGRAMMING 실습 09. 예외처리

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

untitled

[ 정보 ] 과학고 R&E 결과보고서 Monte Carlo Method 를이용한 고교배정시뮬레이션 연구기간 : ~ 연구책임자 : 강대욱 ( 전남대전자컴퓨터공학부 ) 지도교사 : 최미경 ( 전남과학고정보 컴퓨터과 ) 참여학생 : 박진명 ( 전

chapter1,2.doc

PowerPoint 프레젠테이션

1217 WebTrafMon II

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

FileMaker ODBC 및 JDBC 가이드

초보자를 위한 자바 2 21일 완성 - 최신개정판

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter

10.ppt

03-JAVA Syntax(2).PDF

자바GUI실전프로그래밍2_장대원.PDF

Chap7.PDF

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

ch09

rosaec_workshop_talk

Modern Javascript

KYO_SCCD.PDF

untitled

untitled

Java ~ Java program: main() class class» public static void main(string args[])» First.java (main class ) /* The first simple program */ public class

Microsoft PowerPoint - RMI.ppt

Transcription:

API... 3 Class Cache... 5 Class ConnectionPool... 10 Class DataBind... 15 Class Log... 19 Class Module... 23 Class Monitor... 36 Class Repository... 40 Class Service... 86 Class Viewer... 89 API... 97 Class Program... 99 Class Publisher... 105 Class Scheduler... 109 API... 145 OZLauncherDll... 146 FORCS Co., LTD 1

OZ API Developer's Guide (for Java) User Data Store... 151 UDS... 152 UDS... 153 UDS... 155 User Security Logic... 167 USL... 168 USL... 170 USL... 173... 193... 194... 194... 196 C... 204 SchedulerCom... 223 Servlet API... 235 2 FORCS Co., LTD

API Class Cache Class ConnectionPool Class DataBind Class Log Class Module Class Monitor Class Repository Class Service Class Viewer FORCS Co., LTD 3

OZ API Developer's Guide (for Java) API. API. Cache Connection Pool DataBind Log Module Monitor Repository Service Viewer.. Pool JDBC/ODBC,..,,....,,,.,. API. ozsfw35.jar log4.jar Scheduler server. Server Log. (API classpath "log4.jar" ) 4 FORCS Co., LTD

Constructor Summary Cache(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Cache(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary SortProperties getcacheconfiguration() void setcacheconfiguration(sortproperties p) Constructor Detail //Daemon - TCP Server public Cache(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Cache(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port id Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; ex) String id = "admin"; FORCS Co., LTD 5

OZ API Developer's Guide (for Java) pw bautologin useusl ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail getcacheconfigration public SortProperties getcacheconfigration() throws OZCPException. "SortProperties" key. setcacheconfiguration public void setcacheconfiguration(sortproperties p) throws OZCPException. "SortProperties" key. Argument p Class OZCPException(oz.framework.cp.OZCPException) API Exception. API OZCPException. - getmessage public String getmessage(). 6 FORCS Co., LTD

geterrorcode public int geterrorcode(). SortProperties(oz.util.SortProperties.java) getcacheconfigration(), setcacheconfiguration(). - getproperty public synchronized String getproperty(string key) key. setproperty public synchronized Object setproperty(string key, String value) key (value). - Key getproperty() setproperty() key. Key Value Active "true" "false" ex) p.setproperty("datamodule.active", "false"); CACHE_FILE_PAT H ex) p.setproperty("cache_file_path","%oz_home%/cac he"); DM_CACHE_FILE _PATH Data Module ex) p.setproperty("dm_cache_file_path","%oz_home% /cache_dm/"); FORCS Co., LTD 7

OZ API Developer's Guide (for Java) memorycacheval idtime (:) ex) p.setproperty("datamodule.memorycachevalidtime", "100"); diskcachevalidti me (:) ex) p.setproperty("datamodule.diskcachevalidtime","100"); FreeMemoryPerc entage ex) p.setproperty("datamodule.freememorypercentage", "20"); : ". -cachemngr.properties". Sample : CacheSample.java package sample; import oz.framework.api.cache; import org.apache.log4j.*; import oz.util.sortproperties; public class CacheSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default 8 FORCS Co., LTD

Cache cache = null; try { //* // Daemon cache = new Cache(IP, PORT, ID, PWD, false, false); /*/ // Servlet cache = new Cache(URL, ID, PWD, false, false); /**/ SortProperties p = new SortProperties(); /*/ // (setcacheconfiguration) p.setproperty("cache_file_path", "%OZ_HOME%/cache"); // p.setproperty("dm_cache_file_path", "%OZ_HOME%/cache_dm"); // DataModule p.setproperty("datamodule.active", "true"); // p.setproperty("datamodule.memorycachevalidtime", "1000"); // p.setproperty("datamodule.diskcachevalidtime", "1000"); // p.setproperty("datamodule.freememorypercentage", "21"); // cache.setcacheconfiguration(p); /*/ // (getcacheconfiguration) p = cache.getcacheconfigration(); /**/ p.list(system.out); catch(exception e) { e.printstacktrace(); FORCS Co., LTD 9

OZ API Developer's Guide (for Java) Constructor Summary ConnectionPool(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) ConnectionPool(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary void addpool(connectionpoolinfo pool) void removepool(string pool) ConnectionPoolInfo[] getpoolinfolist() ConnectionPoolStatus[] getpoolstatuslist() ConnectionPoolInfo getpoolinfo(string alias) void save() Constructor Detail //Daemon - TCP Server public ConnectionPool(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public ConnectionPool(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; 10 FORCS Co., LTD

port id pw bautologin useusl Daemon ex) int port = 8003; ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail addpool public void addpool(connectionpoolinfo pool) throws OZCPException ConnectionPool. ConnectionPool "ConnectionPoolInfo". Argument pool ConnectionPool ConnectionPoolInfo removepool public void removepool(string pool) throws OZCPException ConnectionPool. Argument pool ConnectionPool getpoolinfolist public ConnectionPoolInfo[] getpoolinfolist() throws OZCPException ConnectionPool ConnectionPoolInfo. getpoolstatuslist public ConnectionPoolStatus[] getpoolstatuslist() throws OZCPException FORCS Co., LTD 11

OZ API Developer's Guide (for Java) ConnectionPool. getpoolinfo public ConnectionPoolInfo getpoolinfo(string alias) throws OZCPException ConnectionPool ConnectionPoolInfo. Argument alias ConnectionPool save public void save() throws OZCPException ConnectionPool. Class ConnectionPoolInfo(oz.framework.db.ConnectionPoolInfo.class). ConnectionPoolStatus(oz.framework.db.ConnectionPoolStatus.class) ConnectionPool. - public final static int OK = 1; ConnectionPool.. Status 1-1 -2 OK ConnectionPool DRIVER_ERROR ConnectionPool JDBC CONNECTION_ERROR ConnectionPool DBMS public final static int DRIVER_ERROR = -1; public final static int CONNECTION_ERROR = -2; 12 FORCS Co., LTD

Sample : ConnectionPoolSample.java package sample; import java.util.hashmap; import oz.framework.api.connectionpool; import oz.framework.db.connectionpoolinfo; import oz.framework.db.connectionpoolstatus; import org.apache.log4j.*; public class ConnectionPoolSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL /**/ // User Info. String ID = "admin";//default String PWD = "admin";//default ConnectionPool conpool = null; try { //* // Daemon conpool = new ConnectionPool(IP, PORT, ID, PWD, false, false); /*/ // Servlet conpool = new ConnectionPool(URL, ID, PWD, false, false); /**/ // (addpool) ConnectionPoolInfo poolinfo = new ConnectionPoolInfo(); poolinfo.setalias("forcs"); // poolinfo.setvendor("mssql"); // ( MSSQL) FORCS Co., LTD 13

OZ API Developer's Guide (for Java) //. // map dbconfig.xml db jdbc url HashMap infos = new HashMap(); infos.put("serveraddress", "127.0.0.1"); infos.put("portno", "1433"); infos.put("dbname", "master"); infos.put("user", "sa"); infos.put("password", "1588"); poolinfo.setitems(infos); poolinfo.setmaxconns(20); // poolinfo.setinitconns(1); // conpool.addpool(poolinfo); // (removepool) String conpoolname = "forcs"; // conpool.removepool(conpoolname); // ConnectionPoolStatus (getpoolstatuslist) ConnectionPoolStatus[] poolstatuslist=conpool.getpoolstatuslist(); for (int i = 0; i < poolstatuslist.length; i++) { ConnectionPoolStatus cps = poolstatuslist[i]; // System.out.println(i); System.out.println("StatusString=" + cps.getstatusstring()); // System.out.println("free=" + new Integer(cps.getFreeConnectionCount())); // System.out.println("checkedout=" + new Integer(cps.getCheckedOutConnectionCount())); System.out.println(); // (save) conpool.save(); catch(exception e) { e.printstacktrace(); 14 FORCS Co., LTD

Constructor Summary DataBind(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) DataBind(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary void setdatabindconfigration(sortproperties config) SortProperties getdatabindconfigration() Constructor Detail //Daemon - TCP Server public DataBind(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public DataBind(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port id Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; ex) String id = "admin"; FORCS Co., LTD 15

OZ API Developer's Guide (for Java) pw bautologin useusl ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail setdatabindconfigration public void setdatabindconfigration(sortproperties config) throws OZCPException DataBind, "databind.properties". Argument config DataBind getdatabindconfigration public SortProperties getdatabindconfigration() throws OZCPException DataBind, "databind.properties". - Key setdatabindconfigration() getdatabindconfigration() key. Key Value ConcurrentFetch Size FetchType "Concurrent" Stream. byte, 4096, 256. :,. 16 FORCS Co., LTD

ConcurrentFirstR ow FetchType "Concurrent"., 0. : 0. Sample : DataBindSample.java package sample; import oz.framework.api.databind; import org.apache.log4j.*; import oz.util.sortproperties; public class DataBindSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP // User Info. String ID = "admin"; //default String PWD = "admin"; //default DataBind databind = null; try { databind = new DataBind(IP, PORT, ID, PWD, false, false); SortProperties p = new SortProperties(); // (setdatabindconfiguration) //Stream p.setproperty("concurrentfetchsize", "4096"); // row p.setproperty("concurrentfirstrow", "0"); databind.setdatabindconfiguration(p); // (getdatabindconfiguration) p = databind.getdatabindconfigration(); java.util.vector vec = p.propertynames(); for(int i=0; i<vec.size(); i++) { String name = (String)vec.elementAt(i); FORCS Co., LTD 17

OZ API Developer's Guide (for Java) System.out.println(name + "=" + p.getproperty(name)); catch (Exception e) { e.printstacktrace(); 18 FORCS Co., LTD

Constructor Summary Log(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Log(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary String getconfiguration() byte[] downloadlog() void downloadlog(string filename) void setconfiguration(string logs) void setpriority(string p) Constructor Detail //Daemon - TCP Server public Log(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Log(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; FORCS Co., LTD 19

OZ API Developer's Guide (for Java) id pw bautologin useusl ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail getconfigure public String getconfigure() throws OZCPException. downloadlog public byte[] downloadlog() throws OZCPException. downloadlog public void downloadlog(string filename) throws OZCPException, IOException. Argument filename setconfigure public void setconfigure(string logs) throws OZCPException. Argument logs, "key=value" ex) String logs="priority=debug" ex) String logs="console.layout=%r[%t]%p%c{1%x-%m%n 20 FORCS Co., LTD

setpriority public void setpriority(string p) throws OZCPException.(INFO, DEBUG, ERROR) Argument p Sample : LogSample.java package sample; import oz.framework.api.log; import org.apache.log4j.*; public class LogSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL // User Info. String ID = "admin"; //default String PWD = "admin"; //default Log log = null; try { // Daemon log = new Log(IP, PORT, ID, PWD, false, false); // Servlet log = new Log(URL, ID, PWD, false, false); // (getconfigure) String conf = null; conf = log.getconfigure(); System.out.println(conf); // (setconfigure, setproirity) String logs = "Priority=INFO"; //log.setconfigure(logs); log.setpriority("debug"); // (downloadlog) byte b[] = log.downloadlog(); String filename = "server.log"; //. log.downloadlog(filename); FORCS Co., LTD 21

OZ API Developer's Guide (for Java) catch(exception e) { e.printstacktrace(); 22 FORCS Co., LTD

Constructor Summary Module(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Module(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary InputString getozd(string item, String category, String[] urls) InputStream getozd(string item, String category, Hashtable formparam, Hashtable odiparam, boolean memoallowed, String password, String id, String pw, HttpServletRequest request) InputStream getozd(string item, String category, Hashtable formparam, Hashtable odiparam, Hashtable odipath, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) InputStream getozd(string item, String category, String serverdmtype, Hashtable formparam, Hashtable odiparam, Hashtable odipath, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) InputStream getozu(string item, String category, String[] urls) void addodiparameter(string odiname, String key, String value) void addodiparameter(string odiname, String item, String category, Hashtable paramhash) void addparameter(string key, String value) void addapplicationparameter(string key, String value) void registodipath (String odiname, String path) void saveozd(string filename, String item, String category, String[] urls) void saveozu(string filename, String item, String category, String[] urls) FORCS Co., LTD 23

OZ API Developer's Guide (for Java) Constructor Detail //Daemon - TCP Server public Module(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Module(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port id pw bautologin useusl Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail getozd public InputStream getozd(string item, String category, String[] urls) throws OZCPException SDM OZD. OZD urls. : API DM_TYPE="Momory", FetchType="Batch".. 24 FORCS Co., LTD

Argument item category urls ( OZR ) OZD URL public final InputStream getozd(string item, String category, Hashtable formparam, Hashtable odiparam, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) throws Exception OZD, OZD.,. : "RequestOZDSample.java". : API DM_TYPE="MEMORY", FetchType="BATCH".. Argument item category formparam odiparam memoallowed password id pw request ( OZR ) : Hashtable (String), (String ). ODI : ODI Hashtable ODI(String), (Hashtable), Hashtable (String), (String). OZD OZD HttpServletRequest public final InputStream getozd(string item, String category, String serverdmtype, Hashtable formparam, Hashtable odiparam, Hashtable odipath, boolean memoallowed, String password, String id, String pwd, HttpServletRequest FORCS Co., LTD 25

OZ API Developer's Guide (for Java) request) OZD, OZD.,. : "RequestOZDSample.java". : API DM_TYPE="MEMORY", FetchType="BATCH".. Argument item category formparam odiparam odipath memoallowed pwd id pw request ( OZR ) : Hashtable (String), (String ). ODI : ODI Hashtable ODI(String), (Hashtable), Hashtable (String), (String). ODI (OZD ODI ) OZD OZD HttpServletRequest getozu public InputStream getozu(string item, String category, String[] urls) throws OZCPException 26 FORCS Co., LTD

SDM OZU. : API DM_TYPE="Momory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". Argument item category urls ( OZA ) OZU URL addodiparameter public void addodiparameter(string odiname, String key, String value) SDM ODI ODI. ODI ODI. odiname ODI Argument key value ODI ODI addodiparameter public void addodiparameter(string odiname, String item, String category, Hashtable paramhash) throws IllegalArgumentException SDM ODI ODI. ODI ODI. ODI SDM SDM. Argument odiname item category paramhash ODI ODI ODI Key, Value Hashtable : OZU paramhash FORCS Co., LTD 27

OZ API Developer's Guide (for Java) OZU addodiparameter() paramhash null addapplicationparameter(key,value) ODI. ex) addapplicationparameter module.addapplicationparameter("odi.odinames", "sample"); module.addapplicationparameter("odi.sample.pcount", "1"); module.addapplicationparameter("odi.sample.args1", "deptid=501"); addparameter public void addparameter(string key, String value) SDM.. Argument key value addapplicationparameter Argument public void addapplicationparameter(string key, String value) SDM. ODI ODI ODI. key ODI value ODI registodipath public void registodipath (String odiname, String path) throws IllegalArgumentException OZD ODI. Argument odiname path ODI ODI saveozd public void saveozd(string filename, String item, String category, String[] urls) throws OZCPException 28 FORCS Co., LTD

OZD. : API DM_TYPE="Momory", FetchType="Batch".. Argument filename item category Urls OZD (.ozr) (.ozr) OZD URL saveozu public void saveozu(string filename, String item, String category, String[] urls) throws OZCPException OZU. : API DM_TYPE="Momory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". Argument filename item category Urls OZU (.oza) (.oza) OZU URL Sample : ModuleSample.java package sample; import java.io.*; import oz.framework.api.module; import org.apache.log4j.*; public class ModuleSample { public static void main(string[] args) { FORCS Co., LTD 29

OZ API Developer's Guide (for Java) 1"); 2"); //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default Module module = null; InputStream stream = null; try { //* // Daemon module = new Module(IP, PORT, ID, PWD, false, false); /*/ // Servlet module = new Module(URL, ID, PWD, false, false); /**/ //module.addodiparameter(" 100 ", "rowcount", "40000"); //replace ODI //module.registodipath(" 100 ", "// 100 //.odi"); // module.addparameter("server", "127.0.0.1"); // module.addparameter("port", "8003"); // module.addparameter("reportname", "// 100.ozr"); // ozd //stream = module.getozd(" 100.ozr", "/"); //FileOutputStream out = new FileOutputStream("D:/TEST_OZD.ozd"); // saveozd(file name, item name, category name) //module.saveozd("d:/test_ozd.ozd", " 100.ozr", "/" ); //out.flush(); //out.close(); // ---------------------------------------------------------------- // OZD // set form parameters module.addparameter("form_param1", "COCO 1"); module.addparameter("form_param2", "COCO 2"); // set odi parameters module.addodiparameter("ozp_param", "ODI_PARAM1", " ODI module.addodiparameter("ozp_param", "ODI_PARAM2", " ODI 30 FORCS Co., LTD

module.addodiparameter("ozp_db", "condition", "KIA"); String[] urls = { "http://211.116.251.20/img/ban_center.gif", "http://211.116.251.20/img/img_interview.gif", "ozp://img/netiq.gif", // ozp:// image "ozp://img/credos.gif", // ozp:// image - table "ozp://img/enterprise.gif", // ozp:// image - table "ozp://img/sephia.gif" // ozp:// image - table ; module.setpassword("1234"); module.setmemoallowed(true); module.saveozd("d:/ozp_test01.ozd", "OZP_TEST.ozr", "/", urls); catch(exception e) { e.printstacktrace(); Sample : RequestOZDSample.java import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import javax.servlet.servletconfig; import oz.server.ozservlet; import javax.servlet.servletexception; import java.io.*; import java.util.*; import oz.framework.cp.io.ozdataoutputstream; public class RequestOZDSample extends OZServlet { private static final int PROTOCOL_VER = 2005; private static final String _ROOT_PATH = "D:/"; private byte[] _buf = new byte[1024]; public void init(servletconfig config) throws ServletException { super.init(config); public void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { dopost(request, response); FORCS Co., LTD 31

OZ API Developer's Guide (for Java) public void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { try { System.out.println("Start to get OZD"); long _JOB_ID = System.currentTimeMillis(); String tempozdfile = _ROOT_PATH + "sample" + _JOB_ID + ".ozd"; String tempwmfile = _ROOT_PATH + "sample" + _JOB_ID + ".mtx"; // Make OZD makeozd(tempozdfile, request); catch(exception e) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); e.printstacktrace(new PrintStream(bout)); bout.flush(); byte[] b = bout.tobytearray(); String error = new String(bout.toByteArray()); bout.close(); System.out.println(error); PrintWriter writer = response.getwriter(); writer.println("requestozdsample : Error"); writer.println(); writer.println(error); writer.flush(); private void writefile(string filename, OZDataOutputStream out) throws IOException { BufferedInputStream bin = null; try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); int len; bin = new BufferedInputStream(new FileInputStream(filename)); while((len = bin.read(_buf)) >= 0) { bout.write(_buf, 0, len); bout.flush(); byte[] buf = bout.tobytearray(); bout.close(); out.writeint(buf.length); out.write(buf,0,buf.length); finally { if(bin!= null) { try { 32 FORCS Co., LTD

bin.close(); catch(exception ex) { private void makeozd(string filename, HttpServletRequest request) throws Exception { InputStream stream = null; try { // Info. String _ITEM = "parameter_test.ozr"; String _CATEGORY = "/"; boolean _MEMOALLOW = true; String _PASSWORD = "1234"; String _UID = "admin"; String _PWD = "admin"; //Form parameter Hashtable _FORM_PARAM = new Hashtable(); _FORM_PARAM.put("formparam1", "FORM 1"); _FORM_PARAM.put("formparam2", "FORM 2"); //ODI parameter Hashtable _ODI_PARAM = new Hashtable(); Hashtable _odi_param = new Hashtable(); _odi_param.put("odiparam1", "ODI 1"); _odi_param.put("odiparam2", "ODI 2"); _ODI_PARAM.put("parameter_test", _odi_param); // call make ozd stream = getozd(_item, _CATEGORY, _FORM_PARAM, _ODI_PARAM, _MEMOALLOW, _PASSWORD, _UID, _PWD, request); //ODI parameter //Hashtable _ODI_PARAM = new Hashtable(); //Hashtable _ODI_PARAM = new Hashtable(); //Hashtable _ODI_PATH = new Hashtable(); //_ODI _PARAM.put("odiparam1", "ODI 1"); //_ODI _PARAM.put("odiparam2", "ODI 2"); //_ODI_PARAM.put("parameter_test", _odi_param); //_ODI_PATH.put("parameter_test", "/test/parameter_test.odi"); //call make ozd //stream = getozd(_item, _CATEGORY, // _FORM_PARAM, _ODI_PARAM, _ODI_PATH, _MEMOALLOW, // _PASSWORD, _UID, _PWD, request); FileOutputStream out = new FileOutputStream(filename); FORCS Co., LTD 33

OZ API Developer's Guide (for Java) copy(stream, out); out.flush(); out.close(); catch(exception e) { e.printstacktrace(); throw e; finally { if(stream!= null) { try { stream.close(); catch(exception e) { // Util method public static int copy(inputstream is, OutputStream os) throws IOException { byte[] buf = new byte[1024]; int rt = 0; int len; while((len = is.read(buf)) >= 0) { os.write(buf, 0, len); rt += len; return rt; Sample : ModuleOZUSample.java package sample; import java.io.*; import oz.framework.api.module; import org.apache.log4j.*; import java.util.hashtable; public class ModuleOZUSample{ public static void main(string[] args){ //. BasicConfigurator.configure(); 34 FORCS Co., LTD

// OZServer Info. String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP // User Info. String ID = "admin"; //default String PWD = "admin"; //default Module module = null; InputStream stream = null; try{ module = new Module(IP, PORT, ID, PWD, false, /*usl*/ false); //ozu module.addapplicationparameter("odi.fetchunit", "DM_PER_DATAMODULE"); module.addapplicationparameter("odi.odinames", "sample"); module.addapplicationparameter("odi.sample.pcount", "1"); module.addapplicationparameter("odi.sample.args1", "deptid=501"); Hashtable hash = new Hashtable(); hash.put("deptid", "501"); String[] urls = { "http://www.anykiki.com/custom/casting//dana/.gif"; // paramhash NULL addapplication Parameter //. module.addodiparameter("sample", "sample.odi", "/sample", null); module.addodiparameter("sample", "sample.odi", "/sample", hash); //ozu, oza,, URL module.saveozu("d:/ozu.ozu", "sample.oza", "/sample", urls); catch(exception e){ e.printstacktrace(); FORCS Co., LTD 35

OZ API Developer's Guide (for Java) Constructor Summary Monitor(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Monitor (String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary Versions getversions() MemoryStatus getmemoryinfo() byte[] downloadmonitorlog() void downloadmonitorlog(string filename) Constructor Detail //Daemon - TCP Server public Monitor(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Monitor(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; 36 FORCS Co., LTD

id pw bautologin useusl ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail getversions public Versions getversions() throws OZCPException. getmemoryinfo public MemoryStatus getmemoryinfo() throws OZCPException (,, ). downloadmonitorlog rototype public byte[] downloadmonitorlog() throws OZCPException. downloadmonitorlog(string filename) public void downloadmonitorlog(string filename) throws OZCPException, IOException filename. FORCS Co., LTD 37

OZ API Developer's Guide (for Java) Class MemoryStatus(oz.server.monitor.MemoryStatus) Server System. Versions(oz.server.monitor.Versions) Server Server System. - public String osname : Server OS public String osversion : Server OS public String javavendor : Server JVM public String javaversion : Server JVM Version public String OZServerVersion : public String CPRelease : OZ Common Protocol public int CPProtocol : OZ Common Protocol public String DMRelease : OZ Data Module public int DMStreaming : OZ Data Module Streaming Sample : MonitorSample.java package sample; import oz.framework.api.monitor; import oz.server.monitor.versions; import oz.server.monitor.memorystatus; import org.apache.log4j.*; public class MonitorSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP 38 FORCS Co., LTD

/*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default Monitor monitor = null; try { //* // Daemon monitor = new Monitor(IP, PORT, ID, PWD, false, false); /*/ // Servlet monitor = new Monitor(URL, ID, PWD, false, false); /**/ // (getserverinformation) Versions v = monitor.getversions(); v._printout(); // (getserverstatus) MemoryStatus ms = monitor.getmemoryinfo(); // = - long usedmemory = ms.gettotalmemory() - ms.getfreemememoy(); // System.out.println("Total Memory="+ms.getTotalMemory()); System.out.println("Used Memory="+usedMemory); System.out.println("Free Memory="+ms.getFreeMememoy()); System.out.println(""); //. byte [] logbytes = monitor.downloadmonitorlog(); //. String logfilename = "monitor.log"; monitor.downloadmonitorlog(logfilename); catch(exception e) { e.printstacktrace(); FORCS Co., LTD 39

OZ API Developer's Guide (for Java) Constructor Summary Repository(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Repository(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary // Configuration public void setrepositoryconfig(sortproperties prop) public SortProperties getrepositoryconfig() // User public int createuser(string username, String pwd, int gid, String description) public void deleteuser(int uid) public void updateusername(int uid, String username) public String getusernamebyid(int uid) // UserLogin public void disableuserlogin(string username) public void updatelogindefault(int logindval) public void enableuserlogin(string username) public void userlogout(int uid) public boolean isuserlogin(int uid) public boolean logintoserver() // UserPwd public boolean checkuserpwd(int uid, String pwd) 40 FORCS Co., LTD

public void updateuserpwd(int uid, String pwd) // UserDesc public void updateuserdescription(int uid, String description) public String getuserdescription(int uid) // UserID public int getgroupidofuser(int uid) public int getuseridbyname(string username) public void updategroupidofuser(int gid, int uid) // UserList public OZRepositoryUser[] getuserlist() public OZRepositoryUser[] getuserlistingroup(int gid) public OZRepositoryUser[] getuserlistauthtoitem(int itemid, byte perm) public OZRepositoryUser[] getuserlistauthtocategory(int categoryid, byte perm) // Group public int creategroup(string groupname, int uppergid) public void deletegroup(int gid) public void updateuppergroupid(int gid, int uppergid) public void updategroupname(int groupid, String groupname) // GroupAdmin public void updateusergroupadmin(int uid, int gid) public boolean isusergroupadmin(int uid, int gid) // GroupList public OZRepositoryGroup[] getgrouplistingroup(int gid) public OZRepositoryGroup getgroupinfo(int gid) public OZRepositoryGroup[] getgrouplistauthtoitem(int itemid, byte perm) public OZRepositoryGroup[] getgrouplistauthtocategory(int categoryid, byte perm) FORCS Co., LTD 41

OZ API Developer's Guide (for Java) // Item public int createitem(string itemname, int itemtype, String itemdescription, int cid, InputStream itemin) public int createitem(string itemname, int itemtype, String itemdescription, String categoryname, InputStream itemin) public int getitemid(string itemname, int itemtype, int cid) public int getitemid(string itemname, int itemtype, String cname) public void deleteitem(int itemid) public InputStream getitem(int itemid) public void updateitemname(int itemid, String itemname) public InputStream getdirectitem(string itemname, int itemtype, String categoryname) public InputStream getdirectitem(string itemname, int itemtype, String categoryname, boolean compresseditem) public void updateitem(int itemid, InputStream input) public void updatedirectitem(string itemname, int itemtype, String categoryname, InputStream input) public boolean hasiteminrepository(string itemname, int itemtype, String categoryname) // InfoByItem public int getcategoryidofitem(int itemid) public void updatecategoryidofitem(int cid, int itemid) // ItemList public OZRepositoryItem[] getitemlist() public OZRepositoryItem getiteminfo(int itemid) public OZRepositoryItem[] getitemlistincategory(int cid) public OZRepositoryItem[] getitemlistincategory(string cname) public OZRepositoryItem[] getitemlistincategory(int cid, int uid, byte perm) public OZRepositoryItem[] getitemlistincategory(string categoryname, int uid, byte perm) public OZRepositoryItem[] getitemlistincategoryauthgroup(int cid, int gid, byte perm) 42 FORCS Co., LTD

public OZRepositoryItem[] getitemlistincategoryauthgroup(string categoryname, int gid, byte perm) public OZRepositoryItem[] getitemlistauthtouser(int uid, byte perm) public OZRepositoryItem[] getitemlistauthtogroup(int gid, byte perm) // Category public int createcategory(string categoryname, int uppercid) public int createcategory(string categorypath) public void deletecategory(int cid) public int getcategoryid(string fullpath) public void updateuppercategoryid(int cid, int uppercid) public void updatecategoryname(int cid, String categoryname) public int getitemcountincategory(int cid) public OZRepositoryCategory[] getcategorylistincategory(int cid) public OZRepositoryCategory[] getcategorylistincategory(int cid, int uid, byte perm) public OZRepositoryCategory[] getcategorylistincategoryauthgroup(int cid, int gid, byte perm) public OZRepositoryCategory getcategoryinfo(int cid) public OZRepositoryCategory[] getcategorylistauthtouser(int uid, int cid, byte perm) public OZRepositoryCategory[] getcategorylistauthtogroup(int gid, int cid, byte perm) // CheckInOut public void checkoutitem(int itemid, int uid, String checkoutfolder) public void undocheckoutitem(int itemid, int uid) public void checkinitem(boolean keepchkout, int itemid, int uid, InputStream itemin) public boolean ischeckoutuser(int itemid, int uid) // History public void rollbackitem(int itemid, int itemversion) public InputStream getspecifiedversionitem(int itemid, int itemversion) public OZRepositoryHistory[] gethistoryitemlist(int itemid) FORCS Co., LTD 43

OZ API Developer's Guide (for Java) public void clearhistoryitem(int itemid, int itemversion) Constructor Detail //Daemon - TCP Server public Repository(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Repository(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port id pw bautologin useusl Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail // Configuration setrepositoryconfig public void setrepositoryconfig(sortproperties prop) throws OZCPException 44 FORCS Co., LTD

. "repository.properties", Key. Argument prop getrepositoryconfig public SortProperties getrepositoryconfig() throws OZCPException. "repository.properties", Key. - Key setrepositoryconfig() getrepositoryconfig() key. Key Value REPOSITORY_TYPE REPOSITORY_FILE_P ATH REPOSITORY_ITEM_ NUMBER_PER_DIREC TORY REPOSITORY_HISTO RY_ITEM_VALID_DA YS REPOSITORY_ADD_C OMPRESSED_ITEM "RDB" "BUILTIN" "true" "false" ex) prop.setproperty("repository_type","rdb"); ex) prop.setproperty("repository_file_path","c:/temp_ repository"); ( : "500") ex) prop.setproperty("repository_item_number_per_ DIRECTORY","100"); ex) prop.setproperty("repository_history_item_vali D_DAYS","20"); ex) prop.setproperty("repository_add_compressed_i TEM","false"); FORCS Co., LTD 45

OZ API Developer's Guide (for Java) // User createuser public int createuser(string username, String pwd, int gid, String description) throws OZCPException, ID. Argument username pwd gid description ID deleteuser public void deleteuser(int uid) throws OZCPException ID. Argument uid ID updateusername public void updateusername(int uid, String username) throws OZCPException ID. Argument uid username ID getusernamebyid public String getusernamebyid(int uid) throws OZCPException ID. Argument uid ID // UserLogin disableuserlogin public void disableuserlogin(string username) throws OZCPException. Argument username 46 FORCS Co., LTD

updatelogindefault public void updatelogindefault(int logindval) throws OZCPException ID. Argument logindval ID enableuserlogin public void enableuserlogin(string username) throws OZCPException. Argument username userlogout public void userlogout(int uid) throws OZCPException ID,. Argument uid ID isuserlogin public boolean isuserlogin(int uid) throws OZCPException ID,. Argument uid ID logintoserver public boolean logintoserver() throws OZCPException. // UserPwd checkuserpwd public boolean checkuserpwd(int uid, String pwd) throws OZCPException. Argument uid pwd ID FORCS Co., LTD 47

OZ API Developer's Guide (for Java) updateuserpwd public void updateuserpwd(int uid, String pwd) throws OZCPException ID. Argument uid pwd ID // UserDesc updateuserdescription public void updateuserdescription(int uid, String description) throws OZCPException ID. Argument uid description ID getuserdescription public String getuserdescription(int uid) throws OZCPException ID. Argument uid ID // UserID getgroupidofuser public int getgroupidofuser(int uid) throws OZCPException ID ID. Argument uid ID ID getuseridbyname public int getuseridbyname(string username) throws OZCPException ID. Argument username ID 48 FORCS Co., LTD

updategroupidofuser public void updategroupidofuser(int gid, int uid) throws OZCPException ID. Argument gid uid ID ID ID // UserList getuserlist public OZRepositoryUser[] getuserlist() throws OZCPException. getuserlistingroup public OZRepositoryUser[] getuserlistingroup(int gid) throws OZCPException ID. Argument gid ID getuserlistauthtoitem public OZRepositoryUser[] getuserlistauthtoitem(int itemid, byte perm) throws OZCPException ID perm. Argument itemid perm ID getuserlistauthtocategory public OZRepositoryUser[] getuserlistauthtocategory(int categoryid, byte perm) throws OZCPException ID perm. Argument categoryid perm ID FORCS Co., LTD 49

OZ API Developer's Guide (for Java) // Group creategroup public int creategroup(string groupname, int uppergid) throws OZCPException, ID. Argument groupname uppergid ID deletegroup public void deletegroup(int gid) throws OZCPException ID. Argument gid ID updategroupname public void updategroupname(int gid, String groupname) throws OZCPException ID. Argument gid groupname ID // GroupAdmin updateusergroupadmin public void updateusergroupadmin(int uid, int gid) throws OZCPException ID. Argument uid gid ID ID isusergroupadmin public boolean isusergroupadmin(int uid, int gid) throws OZCPException ID. Argument uid ID 50 FORCS Co., LTD

gid ID // GroupList getgrouplistingroup public OZRepositoryGroup[] getgrouplistingroup(int gid) throws OZCPException ID. Argument gid ID getgroupinfo public OZRepositoryGroup getgroupinfo(int gid) throws OZCPException ID. Argument gid ID getgrouplistauthtoitem Argument public OZRepositoryGroup[] getgrouplistauthtoitem(int itemid, byte perm) throws OZCPException ID perm. itemid ID perm getgrouplistauthtocategory Argument public OZRepositoryGroup[] getgrouplistauthtocategory(int categoryid, byte perm) throws OZCPException ID perm. categoryid ID perm getsubgrouplist public OZRepositoryGroup[] getsubgrouplist(int gid) throws OZCPException FORCS Co., LTD 51

OZ API Developer's Guide (for Java) Argument. getgrouplistingroup() getsubgrouplist() Recursive.,.... gid ID groupname // Item createitem public int createitem(string itemname, int itemtype, String itemdescription, int cid, InputStream itemin) throws OZCPException public int createitem(string itemname, int itemtype, String itemdescription, String categoryname, InputStream itemin) throws OZCPException, ID. Argument itemname itemtype itemdescription cid itemin categoryname ID getitemid public int getitemid(string itemname, int itemtype, int cid) throws OZCPException public int getitemid(string itemname, int itemtype, String cname) throws OZCPException ID. Argument itemname itemtype cid cname ID 52 FORCS Co., LTD

deleteitem public void deleteitem(int itemid) throws OZCPException. Argument itemid ID getitem public InputStream getitem(int itemid) throws OZCPException ID. Argument itemid ID updateitemname public void updateitemname(int itemid, String itemname) throws OZCPException ID. Argument itemid itemname ID getdirectitem public InputStream getdirectitem(string itemname, int itemtype, String categoryname) throws OZCPException public InputStream getdirectitem(string itemname, int itemtype, String categoryname, boolean compresseditem) throws OZCPException. Argument itemname itemtype categoryname compresseditem updateitem public void updateitem(int itemid, InputStream input) throws OZCPException ID. Argument itemid ID FORCS Co., LTD 53

OZ API Developer's Guide (for Java) input updatedirectitem public void updatedirectitem(string itemname, int itemtype, String categoryname, InputStream input) throws OZCPException ID. Argument itemname itemtype categoryname input hasiteminrepository public boolean hasiteminrepository(string itemname, int itemtype, String categoryname) throws OZCPException. Argument itemname itemtype categoryname // InfoByItem getcategoryidofitem public int getcategoryidofitem(int itemid) throws OZCPException ID ID. Argument itemid ID updatecategoryidofitem public void updatecategoryidofitem(int cid, int itemid) throws OZCPException ID. Argument cid itemid ID ID 54 FORCS Co., LTD

// ItemList getitemlist public OZRepositoryItem[] getitemlist() throws OZCPException. getiteminfo public OZRepositoryItem getiteminfo(int itemid) throws OZCPException ID. Argument itemid ID getitemlistincategory public OZRepositoryItem[] getitemlistincategory(int cid) throws OZCPException public OZRepositoryItem[] getitemlistincategory(string categoryfullpath) throws OZCPException public OZRepositoryItem[] getitemlistincategory(int cid, int uid, byte perm) throws OZCPException public OZRepositoryItem[] getitemlistincategory(string categoryfullpath, int uid, byte perm) throws OZCPException. Argument cid categoryfullpath uid perm ID ID getitemlistincategoryauthgroup public OZRepositoryItem[] getitemlistincategoryauthgroup(int cid, int gid, byte perm) throws OZCPException public OZRepositoryItem[] getitemlistincategoryauthgroup (String categoryfullpath, int gid, byte perm) throws OZCPException. FORCS Co., LTD 55

OZ API Developer's Guide (for Java) Argument cid gid perm categoryfullpath ID ID getitemlistauthtouser public OZRepositoryItem[] getitemlistauthtouser(int uid, byte perm) throws OZCPException ID perm. Argument uid perm ID getitemlistauthtogroup public OZRepositoryItem[] getitemlistauthtogroup(int gid, byte perm) throws OZCPException ID perm. Argument gid perm ID // Category createcategory public int createcategory(string categoryname, int uppercid) throws OZCPException, ID. Argument categoryname uppercid ID createcategory public int createcategory(string categorypath) throws OZCPException, ID. 56 FORCS Co., LTD

Argument categorypath deletecategory public void deletecategory(int cid) throws OZCPException ID. Argument cid ID getcategoryid public int getcategoryid(string fullpath) throws OZCPException ID. Argument fullpath ID updateuppercategoryid public void updateuppercategoryid(int cid, int uppercid) throws OZCPException ID. Argument cid uppercid ID ID updatecategoryname public void updatecategoryname(int cid, String categoryname) throws OZCPException ID. Argument cid categoryname ID getitemcountincategory public int getitemcountincategory(int cid) throws OZCPException. Argument cid ID FORCS Co., LTD 57

OZ API Developer's Guide (for Java) getcategorylistincategory public OZRepositoryCategory[] getcategorylistincategory(int cid) throws OZCPException public OZRepositoryCategory[] getcategorylistincategory(int cid, int uid, byte perm) throws OZCPException. Argument cid uid perm ID ID getcategoryinfo public OZRepositoryCategory getcategoryinfo(int cid) throws OZCPException. Argument cid ID getcategorylistauthtouser public OZRepositoryCategory[] getcategorylistauthtouser(int uid, int cid, byte perm) throws OZCPException ID perm. Argument uid cid perm ID ID getcategorylistauthtogroup public OZRepositoryCategory[] getcategorylistauthtogroup(int gid, int cid, byte perm) throws OZCPException ID perm. Argument gid cid perm ID ID 58 FORCS Co., LTD

// CheckInOut checkoutitem public void checkoutitem(int itemid, int uid, String checkoutfolder) throws OZCPException ID. Argument itemid uid checkoutfolder ID ID undocheckoutitem public void undocheckoutitem(int itemid, int uid) throws OZCPException ID. Argument itemid uid ID ID checkinitem public void checkinitem(boolean keepchkout, int itemid, int uid, InputStream itemin) throws OZCPException ID. Argument keepchkout itemid uid itemin ID ID ischeckoutuser public boolean ischeckoutuser(int itemid, int uid) throws OZCPException. Argument itemid uid ID ID // History getspecifiedversionitem FORCS Co., LTD 59

OZ API Developer's Guide (for Java) public InputStream getspecifiedversionitem(int itemid, int itemversion) throws OZCPException ID. Argument itemid itemversion ID gethistoryitemlist public OZRepositoryHistory[] gethistoryitemlist(int itemid) throws OZCPException. Argument itemid ID clearhistoryitem public void clearhistoryitem(int itemid, int itemversion) throws OZCPException. Argument itemid itemversion ID rollbackitem public void rollbackitem(int itemid, int itemversion) throws OZCPException. Argument itemid itemversion ID Class OZRepositoryUser(oz.framework.repository.OZRepositoryUser),,,,. - getusername 60 FORCS Co., LTD

public String getusername(). getuserid public int getuserid() ID. getgrouplist public java.util.vector getgrouplist(). getdescription public String getdescription(). getpassword public String getpassword(). getpermission public byte getpermission(). 0 : None( ) 1 : View( ) 3 : Read( ) 7 : Write( ) getdirectpermission public byte getdirectpermission(). getindirectpermission public byte getindirectpermission(). FORCS Co., LTD 61

OZ API Developer's Guide (for Java) getisloggedin public boolean getisloggedin(). getsessionid public int getsessionid() ID. getisloginenabled public boolean getisloginenabled(). OZRepositoryUser[](oz.framework.repository.OZRepositoryUser[]). OZRepositoryGroup(oz.framework.repository.OZRepositoryGroup),,,,. - getgroupname public String getgroupname(). getgroupid public int getgroupid() ID. getparentgroupid public int getparentgroupid() ID. getgroupadminlist public java.util.vector getgroupadminlist() 62 FORCS Co., LTD

. getdirectpermission public byte getdirectpermission(). getindirectpermission public byte getindirectpermission(). getpermission public byte getpermission(). getdescription public String getdescription(). getfullpath public String getfullpath(). OZRepositoryGroup[](oz.framework.repository.OZRepositoryGroup[]). OZRepositoryItem(oz.framework.repository.OZRepositoryItem),,,,. - getitemname public String getitemname(). FORCS Co., LTD 63

OZ API Developer's Guide (for Java) getitemid public int getitemid() ID. getitemtype public int getitemtype(). 10000 : ODI_FILE 20001 : OZR_FILE 20002 : SDM_FILE 20003 : USDM_FILE 20004 : OZD_FILE 30001 : UIMG_FILE getdescription public String getdescription(). getcheckoutuserid public int getcheckoutuserid() ID. getcheckoutusername public String getcheckoutusername(). getcheckoutfolder public String getcheckoutfolder(). getupdatetime public java.util.date getupdatetime(). 64 FORCS Co., LTD

getischeckedout public boolean getischeckedout(). getdirectpermission public byte getdirectpermission(). getindirectpermission public byte getindirectpermission(). getadminlist public java.util.vector getadminlist(). getcategorylist public java.util.vector getcategorylist(). OZRepositoryItem[](oz.framework.repository.OZRepositoryItem[]). OZRepositoryCategory(oz.framework.repository.OZRepositoryCategory). - getcategoryname public String getcategoryname(). getcategoryid public int getcategoryid() ID. FORCS Co., LTD 65

OZ API Developer's Guide (for Java) getparentcategoryid public int getparentcategoryid() ID. getcategoryadminlist public java.util.vector getcategoryadminlist(). getdirectpermission public byte getdirectpermission(). getindirectpermission public byte getindirectpermission(). getpermission public byte getpermission(). getdescription public String getdescription(). getfullpath public String getfullpath(). OZRepositoryCategory[](oz.framework.repository.OZRepositoryCategory[] ). 66 FORCS Co., LTD

OZRepositoryHistory(oz.framework.repository.OZRepositoryHistory). - gethistoryitempath public String gethistoryitempath(). gethistoryitemversion public int gethistoryitemversion(). gethistorydate public String gethistorydate(). gethistorycheckinuser public String gethistorycheckinuser(). OZRepositoryHistory[](oz.framework.repository.OZRepositoryHistory[]). Sample : RepositorySample.java package sample; import oz.framework.api.repository; import oz.util.sortproperties; import oz.framework.repository.ozrepositoryitem; import oz.framework.repository.ozrepositoryuser; import oz.framework.repository.ozrepositoryhistory; import oz.framework.repository.ozrepositorygroup; import oz.framework.repository.ozrepositorycategory; import oz.framework.cp.ozcpexception; import oz.dm.hc.hcdatamodule; FORCS Co., LTD 67

OZ API Developer's Guide (for Java) import oz.dm.dmconst; import java.io.*; import java.net.*; import org.apache.log4j.*; import java.io.ioexception; import java.util.*; public class RepositorySample { private static Repository repository = null; public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default try { // Daemon repository = new Repository(IP, PORT, ID, PWD, false, false); /*/ // Servlet repository = new Repository(URL, ID, PWD, false, false); /**/ repositoryconfiguration(); usertest(); grouptest(); itemtest(); catch (Exception e) { e.printstacktrace(); private static void repositoryconfiguration() throws Exception { //Repository configuration. 68 FORCS Co., LTD

System.out.println("Repository.getRepositoryConfig()"); SortProperties props = repository.getrepositoryconfig(); props.list(system.out); //Repository Configuration SortProperties prop = new SortProperties(); prop.setproperty("repository_type", "RDB"); //RDB, FILESYSTEM, USER prop.setproperty("repository_file_path", "c:/temp_repository"); prop.setproperty("repository_item_number_per_directory", "100"); prop.setproperty("repository_history_item_valid_days", "20"); //repository.setrepositoryconfig(prop); private static void historytest(int itemid) throws Exception { final int itemversion = 0; // itemversion, itemid System.out.println("Repository.getSpecifiedVersionItem( int itemid, int itemversion)"); InputStream in = repository.getspecifiedversionitem( itemid, itemversion); download(repository.getspecifiedversionitem(itemid, itemversion), "getspecifiedversionitem" + repository.getiteminfo(itemid).getitemname()); // itemid System.out.println("Repository.getHistoryItemList(int itemid)"); OZRepositoryHistory[] historyinfolist = repository.gethistoryitemlist(itemid); if (historyinfolist!= null) { for (int i = 0; i < historyinfolist.length; i++) { OZRepositoryHistory historyinfo = historyinfolist[i]; System.out.println("HistoryDate : " + historyinfo.gethistorydate()); System.out.println("HistoryItemPath : " + historyinfo.gethistoryitempath()); System.out.println("HistoryItemVersion : " + historyinfo.gethistoryitemversion()); // Item version history. // history // System.out.println("Repository.clearHistoryItem( // int itemid, int itemversion)"); // repository.clearhistoryitem(itemid, itemversion); // Item itemversion. FORCS Co., LTD 69

OZ API Developer's Guide (for Java) System.out.println("Repository.rollBackItem( int itemid, int itemversion)"); repository.rollbackitem(itemid, itemversion); private static void checkinouttest(int itemid) throws Exception{ final int uid = repository.getuseridbyname("admin"); String filename = "check in out test.txt"; createfile(filename); // User(uid) Item(itemid) checkout. System.out.println("Repository.checkOutItem( int itemid, int uid, String checkoutfolder)"); String checkoutfolder = ".."; repository.checkoutitem(itemid, uid, checkoutfolder); // uid itemid checkout, checkout cancel. // System.out.println("Repository.undoCheckOutItem( // int itemid, int uid)"); // repository.undocheckoutitem(itemid, uid); // item checkin. keepchkout check-in check-out System.out.println( "Repository.checkInItem(boolean keepchkout, int itemid, int uid, InputStream item_in)"); boolean keepchkout = false; FileInputStream in = new FileInputStream(fileName); repository.checkinitem(keepchkout, itemid, uid, in); in.close(); // uid user itemid check out. System.out.println("Repository.isCheckOutUser(int itemid, int uid)"); System.out.println("Does UID[" + uid + "] check out the item[" + itemid + "]? " + repository.ischeckoutuser(itemid, uid)); removefile(filename); private static void categorytest() throws Exception { final int uid = repository.getuseridbyname("admin"); int gid = repository.getgroupidofuser(uid); int cid, parent_cid; final byte authread = 0x02, authview = 0x01; String categoryname = null; OZRepositoryCategory[] categoryinfolist = null; //. System.out.println("Repository.createCategory(String categorypath)"); categoryname = "/Poultry"; cid = repository.createcategory(categoryname); 70 FORCS Co., LTD

System.out.println( "categorypath [categoryid] : " + categoryname + "[" + cid + "]"); // upper_cid category_name. System.out.println("Repository.createCategory(String category_name, int upper_cid)"); String childcategoryname = "Chickens"; parent_cid = cid; cid = repository.createcategory(childcategoryname, parent_cid); System.out.println("New new_category_name [new_categoryid] : " + childcategoryname + "[" + cid + "]"); // cid. System.out.println("Repository.deleteCategory(int cid)"); repository.deletecategory(cid); cid = parent_cid; // Full Path. System.out.println("Repository.getCategoryID(String fullpath)"); System.out.println("the full Path [" + categoryname + "]'s category ID : " + repository.getcategoryid(categoryname)); //. System.out.println("Repository.updateCategoryName(int cid, String categoryname)"); categoryname = "Fishes"; System.out.println("Before Update CategoryName : " + (repository.getcategoryinfo(cid)).getcategoryname()); repository.updatecategoryname(cid, categoryname); System.out.println("After Update CategoryName : " + (repository.getcategoryinfo(cid)).getcategoryname()); //. System.out.println("Repository.updateUpperCategoryId( int cid, int uppercid)"); int new_cid = repository.createcategory("/category Test"); System.out.println("Before Update UpperCategoryID : " + repository.getcategoryinfo(cid)).getparentcategoryid()); repository.updateuppercategoryid(cid, new_cid); System.out.println("After Update UpperCategoryID : " + (repository.getcategoryinfo(cid)).getparentcategoryid()); // cid. System.out.println("Repository.getItemCountInCategory(String cid)"); System.out.println("Item count in the category id [" + cid + "] : " + repository.getitemcountincategory(cid) + ""); // cid. System.out.println("Repository.getCategoryListInCategory(int cid) "); FORCS Co., LTD 71

OZ API Developer's Guide (for Java) categoryinfolist = repository.getcategorylistincategory(0); showcategoryinfolist(categoryinfolist); // id //. System.out.println("Repository.getCategoryListInCategory( int categoryid, int userid, byte perm)"); categoryinfolist = repository.getcategorylistincategory(cid, uid, authview); showcategoryinfolist(categoryinfolist); // gid //. System.out.println( "Repository.getCategoryListInCategoryAuthGroup(int categoryid, int groupid, byte perm)"); categoryinfolist = repository.getcategorylistincategoryauthgroup(cid, gid, authview); showcategoryinfolist(categoryinfolist); // id. System.out.println("Repository.getCategoryInfo(int cid))"); showcategory(repository.getcategoryinfo(cid)); // //. System.out.println( "Repository.getCategoryListAuthToUser(int userid,int categoryid, byte perm) "); categoryinfolist = repository.getcategorylistauthtouser(uid, cid, authread); showcategoryinfolist(categoryinfolist); // // System.out.println("Repository.getCategoryListAuthToGroup(int groupid, int categoryid, byte perm) "); categoryinfolist = repository.getcategorylistauthtogroup(gid, cid, authread); showcategoryinfolist(categoryinfolist); repository.deletecategory(cid); repository.deletecategory(new_cid); private static void showcategoryinfolist( OZRepositoryCategory[] categorylist) { if(categorylist == null) 72 FORCS Co., LTD

return; for(int i=0; i < categorylist.length; i++) { showcategory(categorylist[i]); private static void showcategory(ozrepositorycategory c) { System.out.println("CategoryId : " + c.getcategoryid()); System.out.println("CategoryName : " + c.getcategoryname()); System.out.println("CategoryUpperId : " + c.getparentcategoryid()); System.out.println("Permission : " + c.getpermission()); private static void itemlisttest(int itemid) throws Exception { FileOutputStream fos = null; InputStream in = null; OZRepositoryItem[] iteminfolist = null; OZRepositoryUser[] userinfolist = null; OZRepositoryCategory[] categoryinfolist = null; OZRepositoryGroup[] grouplist = null; final String username = "admin"; String itemname = repository.getiteminfo(itemid).getitemname(); int uid = repository.getuseridbyname(username); int cid = repository.getcategoryidofitem(itemid); int gid = repository.getgroupidofitem(itemid); String categoryname = "/" + repository.getcategoryinfo(cid).getcategoryname(); final byte authrw = 0x07, authread = 0x02; byte[] buf = null; /****************************************************************************. //. System.out.println("Repository.getItemList()"); iteminfolist = repository.getitemlist(); showiteminfolist(iteminfolist); ****************************************************************************/ //. System.out.println("Repository.getItemInfo(int itemid)"); OZRepositoryItem iteminfo = repository.getiteminfo(itemid); showitem(iteminfo); // id. System.out.println("Repository.getItemListInCategory(int cid)"); iteminfolist = repository.getitemlistincategory(cid); showiteminfolist(iteminfolist); FORCS Co., LTD 73

OZ API Developer's Guide (for Java) //. System.out.println( "Repository.getItemListInCategory(String categoryname)"); iteminfolist = repository.getitemlistincategory(categoryname); showiteminfolist(iteminfolist); // userid //. System.out.println( "Repository.getItemListInCategory(String cname,int userid, byte perm)"); iteminfolist = repository.getitemlistincategory(categoryname, uid, authrw); showiteminfolist(iteminfolist); // categoryid userid //. System.out.println("Repository.getItemListInCategory(int cid, int userid, byte perm)"); iteminfolist = repository.getitemlistincategory(cid, uid, authread); showiteminfolist(iteminfolist); // ID GroupID //. System.out.println("Repository.getItemListInCategoryAuthGroup(int cid, int groupid, byte perm)"); iteminfolist = repository.getitemlistincategoryauthgroup(cid, gid, authread); showiteminfolist(iteminfolist); // GroupID //. System.out.println("Repository.getItemListInCategoryAuthGroup + (String categoryname, int groupid, byte perm)"); iteminfolist = repository.getitemlistincategoryauthgroup(categoryname, gid, authread); showiteminfolist(iteminfolist); // uid. System.out.println("Repository.getItemListAuthToUser(int uid, byte perm)"); iteminfolist = repository.getitemlistauthtouser(uid, authread); showiteminfolist(iteminfolist); // gid. System.out.println("Repository.getItemListAuthToGroup(int gid, byte perm)"); iteminfolist = repository.getitemlistauthtogroup(gid, authread); 74 FORCS Co., LTD

showiteminfolist(iteminfolist); /**************************************************************************** //. System.out.println( "Repository.findItemByItemIndex(String[] itemindex, int[] oper)"); String[] itemindex = {"index test 1", "index test 2", "index test 3"; int[] oper = {2, 2; //1 => AND, 2 => OR iteminfolist = repository.finditembyitemindex(itemindex, oper); showiteminfolist(iteminfolist); ****************************************************************************/ private static void showiteminfolist(ozrepositoryitem[] iteminfolist) { if(iteminfolist == null) return; System.out.println( "[i]categoryname:itemname:itemid--------------------------------"); OZRepositoryItem item; for(int i=0; i < iteminfolist.length; i++) { item = iteminfolist[i]; Vector v = item.getcategorylist(); Iterator iter = v.iterator(); while(iter.hasnext()) { System.out.println("[" + i + "]" + iter.next() + ":" + item.getitemname() + ":" + item.getitemid()); private static void showitem(ozrepositoryitem item) { Vector v = item.getcategorylist(); Iterator iter = v.iterator(); while(iter.hasnext()) { System.out.println(" " + iter.next() + ":" + item.getitemname() + ":" + item.getitemid()); private static void infobyitemtest(int itemid) throws Exception { // System.out.println("Repository.getCategoryIdOfItem(int itemid)"); System.out.println("the ItemID[" + itemid + "]'s category ID : " + repository.getcategoryidofitem(itemid)); System.out.println( "Repository.updateCategoryIdOfItem(int cid, int itemid)"); FORCS Co., LTD 75

OZ API Developer's Guide (for Java) int cid = repository.getcategoryidofitem(itemid); System.out.println("Before Update CategoryID : " + repository.getcategoryidofitem(itemid)); repository.updatecategoryidofitem(cid, itemid); System.out.println("After Update CategoryID : " + repository.getcategoryidofitem(itemid)); private static void itemtest() throws Exception { final String itemfilename = " 100.odi"; String itemname = itemfilename; String categoryname = "/Item Test"; String itemdescription = "Test of item creation"; final int itemtype = 10000; // OZItemInfo.ODI_FILE int cid = repository.createcategory(categoryname); int itemid; // return. System.out.println( "Repository.createItem(name, type, desc, cid, input_stream)"); itemid = repository.createitem(itemfilename, itemtype, itemdescription, cid, new FileInputStream(itemFileName)); System.out.println("item_name [iid] : " + itemname + "[" + itemid + "]"); // return // System.out.println( // "Repository.createItem(name, type, desc, category_name, // input_stream)"); // itemid = repository.createitem(itemfilename, itemtype, // itemdescription, categoryname, // new FileInputStream(itemFileName)); // System.out.println("item_name [iid] : " + itemfilename + "[" + // itemid + "]"); //,, // ID System.out.println("Repository.getItemId(String item_name, int item_type, Sring categoryname)"); itemid = repository.getitemid(itemname, itemtype, categoryname); System.out.println("Item ID [" + itemid + "]"); //,, id // ID System.out.println( "Repository.getItemId(String item_name, int item_type, int cid)"); 76 FORCS Co., LTD

itemid = repository.getitemid(itemname, itemtype, cid); System.out.println("Item ID [" + itemid + "]"); //. System.out.println("Repository.getItem(int itemid, int cid)"); System.out.println("Read the item from server and create a new file."); download(repository.getitem(itemid, cid),"getitem" + itemname); //. System.out.println("Repository.updateItemName(int itemid, String itemname) "); itemname = "Changed item name.odi"; System.out.println("Before Update ItemName : " + (repository.getiteminfo(itemid)).getitemname()); repository.updateitemname(itemid, itemname); System.out.println("After Update ItemName : " + (repository.getiteminfo(itemid)).getitemname()); //. System.out.println("Repository.getDirectItem + (String itemname, int itemtype, String categoryname, boolean compresseditem)"); System.out.println("Read the item from server and create a new file."); boolean compress = true; download(repository.getdirectitem(itemname, itemtype, categoryname, compress), "getdirectitem_compressed" + itemname); //. System.out.println("Repository.getDirectItem(String itemname, int itemtype, String categoryname)"); System.out.println("Read the item from server and create a new file."); download(repository.getdirectitem(itemname, itemtype, categoryname), "getdirectitem_uncompressed" + itemname); FileInputStream fis; /**************************************************************************** //. System.out.println("Repository.updateItem(int itemid, InputStream input)"); fis = new FileInputStream(itemFileName); repository.updateitem(itemid, fis); fis.close(); //. System.out.println( "Repository.updateDirectItem(String itemname, int itemtype, String categoryname, InputStream input)"); fis = new FileInputStream(itemFileName); FORCS Co., LTD 77

OZ API Developer's Guide (for Java) repository.updatedirectitem(itemname, itemtype, categoryname, fis); fis.close(); ****************************************************************************/ // System.out.println("Repository.hasItemInRepository( String itemname, int itemtype, String categoryname)"); System.out.println("Does item[" + itemname + "] exist in category[" + categoryname + "]? " + repository.hasiteminrepository(itemname, itemtype, categoryname)); infobyitemtest(itemid); itemlisttest(itemid); categorytest(); checkinouttest(itemid); historytest(itemid); //. System.out.println("Repository.deleteItem(int itemid)"); repository.deleteitem(itemid); repository.deletecategory(cid); private static void download(inputstream in, String filename) throws Exception { byte[] buf = new byte[in.available()]; in.read(buf); in.close(); FileOutputStream fos = new FileOutputStream(fileName); fos.write(buf); fos.flush(); fos.close(); private static void grouplisttest(int gid) throws Exception { // gid. System.out.println("Repository.getGroupListInGroup(int gid))"); OZRepositoryGroup[] groupinfolist = repository.getgrouplistingroup(0); showgrouplist(groupinfolist); // gid. System.out.println("Repository.getGroupInfo(int gid))"); OZRepositoryGroup groupinfo = repository.getgroupinfo(gid); showgroup(groupinfo); // itemid perm. 78 FORCS Co., LTD

System.out.println("Repository.getGroupListAuthToItem(int itemid, byte perm)"); String sdmname = "SDM for test.sdm"; final int itemtype = 20002; //OZFrameworkConst.SDM_FILE; createfile(sdmname); int cid = repository.createcategory("/user List Test"); int itemid = repository.createitem(sdmname, itemtype, "", cid, new FileInputStream(sdmName)); final byte authread = 0x02; groupinfolist = repository.getgrouplistauthtoitem(itemid, authread); showgrouplist(groupinfolist); // categoryid. System.out.println("Repository.getGroupListAuthToCategory( int categoryid, byte perm) "); groupinfolist = repository.getgrouplistauthtocategory(cid, authread); showgrouplist(groupinfolist); repository.deleteitem(itemid); repository.deletecategory(cid); removefile(sdmname); private static void showgrouplist(ozrepositorygroup[] grouplist) { if(grouplist == null) return; for(int i=0; i < grouplist.length; i++) { showgroup(grouplist[i]); private static void showgroup(ozrepositorygroup group) { System.out.println("GroupId : " + group.getgroupid()); System.out.println("GroupName : " + group.getgroupname()); System.out.println("GroupUpperId : " + group.getparentgroupid()); Vector v = group.getgroupadminlist(); showgroupadminusername(v); System.out.println("Permission : " + group.getpermission()); private static void showgroupadminusername(vector v) { Iterator it = v.iterator(); while (it.hasnext()) { System.out.println("GroupAdminUserName : " + it.next()); FORCS Co., LTD 79

OZ API Developer's Guide (for Java) private static void groupadmintest(int gid) throws Exception{ // Group Admin uid. System.out.println("Repository.updateUserGroupAdmin(int uid, int gid)"); int uid = repository.createuser("test id", "1234567", gid, ""); System.out.println("Before : "); showgroupadminusername(repository.getgroupinfo(gid).getgroupadminlist ()); repository.updateusergroupadmin(uid, gid); System.out.println("After : "); showgroupadminusername(repository.getgroupinfo(gid).getgroupadminlist() ); // uid gid group admin. System.out.println("Repository.isUserGroupAdmin(int uid, int gid)"); System.out.println("Is this user[" + uid + "] a group admin in Group[" + gid + "]? " + repository.isusergroupadmin(uid, gid)); repository.deleteuser(uid); private static void grouptest() throws Exception { // upper_gid System.out.println("Repository.createGroup(String group_name, int upper_gid)"); String groupname = "forcs"; int root_gid = 0; int parent_gid = root_gid; int gid = repository.creategroup(groupname, parent_gid); System.out.println("group_name [upper_gid] : " + groupname + "[" + gid + "]"); // gid System.out.println("Repository.deleteGroup(int gid)"); int temp_gid = repository.creategroup("temporary group", root_gid); repository.deletegroup(temp_gid); //. System.out.println("Repository.updateUpperGroupId(int gid, int uppergid) "); parent_gid = repository.creategroup("temporary group", root_gid); System.out.println("Before Update UpperGroupID : " + (repository.getgroupinfo(gid)).getparentgroupid()); repository.updateuppergroupid(gid, parent_gid); System.out.println("After Update UpperGroupID : " + 80 FORCS Co., LTD

(repository.getgroupinfo(gid)).getparentgroupid()); //. System.out.println("Repository.updateGroupName(int groupid, String groupname)"); String newgroupname = "( "; System.out.println("Before Update GroupIDofUser : " + (repository.getgroupinfo(gid)).getgroupname()); repository.updategroupname(gid, newgroupname); System.out.println("After Update GroupIDofUser : " + (repository.getgroupinfo(gid)).getgroupname()); groupadmintest(gid); grouplisttest(gid); repository.deletegroup(parent_gid); private static void createfile(string filename) throws Exception { FileOutputStream fos = new FileOutputStream(new File(fileName)); fos.write("dummy data".getbytes()); fos.flush(); fos.close(); private static void removefile(string filename) { try { File f = new File(fileName); f.delete(); catch(exception e) { private static void userlisttest(int uid) throws Exception { OZRepositoryUser userinfo = null; OZRepositoryUser[] userinfolist = null; int gid = repository.getgroupidofuser(uid); final String sdmname = "SDM for test.sdm"; final int itemtype = 20002; //OZRepositoryItem.SDM_FILE; createfile(sdmname); int cid = repository.createcategory("/user List Test"); int itemid = repository.createitem(sdmname, itemtype, "", cid, new FileInputStream(sdmName)); final byte authread = 0x02; //. FORCS Co., LTD 81

OZ API Developer's Guide (for Java) System.out.println("Repository.getUserList()"); userinfolist = repository.getuserlist(); showuserinfolist(userinfolist); //. System.out.println("Repository.getUserListInGroup(int gid)"); userinfolist = repository.getuserlistingroup(gid); showuserinfolist(userinfolist); //. System.out.println( "Repository.getUserListAuthToItem(int itemid, byte perm)"); userinfolist = repository.getuserlistauthtoitem(itemid, authread); showuserinfolist(userinfolist); //. System.out.println( "Repository.getUserListAuthToCategory(int categoryid, byte perm)"); userinfolist = repository.getuserlistauthtocategory(cid, authread); showuserinfolist(userinfolist); repository.deleteitem(itemid); repository.deletecategory(cid); removefile(sdmname); private static void showuserinfolist(ozrepositoryuser[] userinfolist) { if (userinfolist == null) return; OZRepositoryUser user; Iterator iter; System.out.println( "[i]groupname:username:userid-----------------------------------"); for (int i = 0; i < userinfolist.length; i++) { user = userinfolist[i]; iter = user.getgrouplist().iterator(); while (iter.hasnext()) { System.out.println("[" + i + "]" + iter.next() + ":" + user.getusername() + ":" + user.getuserid()); private static void useridtest(int uid) throws Exception { // Group ID. System.out.println( "Repository.updateGroupIdOfUser(int gid, int uid)"); 82 FORCS Co., LTD

int old_gid = repository.getgroupidofuser(uid); int new_gid = repository.creategroup("group_for_test", old_gid); System.out.println("Before Update GroupIDofUser : " + repository.getgroupidofuser(uid)); repository.updategroupidofuser(new_gid, uid); System.out.println("After Update GroupIDofUser : " + repository.getgroupidofuser(uid)); //. System.out.println("Repository.getUserIdbyName(String user_name)"); String username = repository.getusernamebyid(uid); uid = repository.getuseridbyname(username); System.out.println("uid[" + uid + "]" + username); repository.updategroupidofuser(old_gid, uid); repository.deletegroup(new_gid); private static void userdesctest(int uid) throws Exception { //. System.out.println( "Repository.updateUserDescription(int uid, String description) "); String description = ".."; System.out.println("Before Update Description : " + repository.getuserdescription(uid)); repository.updateuserdescription(uid, description); System.out.println("After Update Description : " + repository.getuserdescription(uid)); private static void userpwdtest(int uid) throws Exception { // uid pwd check. System.out.println("Repository.checkUserPwd(int uid, String pwd)"); String pwd = "admin"; // uid pwd. System.out.println("Repository.updateUserPwd(int uid, String pwd)"); System.out.println("Before : UserName : " + repository.checkuserpwd(uid, pwd)); repository.updateuserpwd(uid, pwd); System.out.println("After : UserName : " + repository.checkuserpwd(uid, pwd)); private static void userlogintest(int uid) throws Exception { // default login user loginval. System.out.println("Repository.updateLoginDefault(int logindval)"); int logindval = uid; // uid user default login setting. repository.updatelogindefault(logindval); FORCS Co., LTD 83

OZ API Developer's Guide (for Java) // username login disable. System.out.println("Repository.disableUserLogin(String username)"); String username = repository.getusernamebyid(uid); repository.disableuserlogin("'" + username + "'"); // username login enable. System.out.println("Repository.enableUserLogin(String username)"); repository.enableuserlogin("'" + username + "'"); //. System.out.println("Repository.loginToServer()"); System.out.println("loginToServer? " + repository.logintoserver()); // uid logout. System.out.println("Repository.userLogout(int uid)"); System.out.println("Before: Is this user[" + uid + "] logged on now? " + repository.isuserlogin(uid)); //repository.userlogout(uid); System.out.println("After: Is this user[" + uid + "] logged on now? " + repository.isuserlogin(uid)); private static void usertest() throws Exception { //. System.out.println( "Repository.createUser(String user_name, String pwd, int gid, String description)"); String username = "forcs"; String pwd = "111111"; int gid = 0; // String description = "() "; int uid = repository.createuser(username, pwd, gid, description); System.out.println("user_name [uid] : " + username + "[" + uid + "]"); //. System.out.println( "Repository.updateUserName(int userid, String username)"); String newusername = ""; System.out.println("Before : UserName : " + repository.getusernamebyid(uid)); repository.updateusername(uid, newusername); System.out.println("After : UserName : " + repository.getusernamebyid(uid)); userlogintest(uid); 84 FORCS Co., LTD

userdesctest(uid); useridtest(uid); userlisttest(uid); userpwdtest(uid); //. System.out.println("Repository.deleteUser(int uid)"); repository.deleteuser(uid); FORCS Co., LTD 85

OZ API Developer's Guide (for Java) Constructor Summary Service(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Service(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary void garbagecollect() void stop(boolean check) void restart() Constructor Detail //Daemon - TCP Server public Service(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Service(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; 86 FORCS Co., LTD

id pw bautologin useusl ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail garbagecollect public void garbagecollect() throws OZCPException JVM garbage collection. stop public void stop(boolean check) throws OZCPException. Argument check true : false : restart public void restart() throws OZCPException. Sample : ServiceSample.java package sample; import oz.framework.api.service; import org.apache.log4j.*; FORCS Co., LTD 87

OZ API Developer's Guide (for Java) public class ServiceSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default Service service = null; try { //* // Daemon service = new Service(IP, PORT, ID, PWD, false, false); /*/ // Servlet service = new Service(URL, ID, PWD, false, false); /**/ System.out.println(service.getHandlerCount()); // garbagecollection (garbagecollects) service.garbagecollect(); // (restart) //service.restart(); // (serverstop) boolean check = true;// service.stop(check); catch(exception e) { 88 FORCS Co., LTD

Constructor Summary Viewer(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Viewer(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary byte[] getbytearrayform(string reportname, String categoryname) InputStram getform(string reportname, String CategoryName, boolean iscompress) Parameter[] getuserparameterswithdefaultvalue(string itemname, int itemtype, String categoryname) HCDataModule gethcusdm(string filename, String categoryname) HCDataModule getdatamodule(inputstream sdminput) HCDataModule getdatamodules(string odiname, String CategoryName, Parameter[] parameters, boolean docompress, boolean forcerefresh) HCDataModule getdatamodule(string odiname, String categoryname, Parameter[] parameters, boolean docompress, boolean forcerefresh, String[] invaliddataset, MaxRowsOfSet[] maxrows) Constructor Detail FORCS Co., LTD 89

OZ API Developer's Guide (for Java) //Daemon - TCP Server public Viewer(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Viewer(String url, String id, String pw, boolean bautologin, boolean useusl) Argument url ip port id pw bautologin useusl Servlet URL ex) String url = "http://127.0.0.1/oz/server"; Daemon IP ex) String ip = "127.0.0.1"; Daemon ex) int port = 8003; ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail getbytearrayform public byte[] getbytearrayform(string reportname, String categoryname) throws OZCPException. Argument reportname categoryname getform public InputStream getform(string reportname, String categoryname, boolean iscompress) throws OZCPException 90 FORCS Co., LTD

. Argument reportname categoryname iscompress getuserparameterswithdefaultvalue public Parameter[] getuserparameterswithdefaultvalue(string itemname, int itemtype, String categoryname) throws OZCPException. itemname Argument itemtype (OZR : 20001 / ODI : 10000) categoryname iscompress gethcusdm public HCDataModule gethcusdm(string filename, String categoryname) throws OZCPException SDM. Argument filename categoryname getdatamodules public HCDataModule getdatamodule(inputstream sdminput) throws OZCPException SDM. FETCH (batch), DataModule 2.5 Normal. Argument sdminput SDM getdatamodules FORCS Co., LTD 91

OZ API Developer's Guide (for Java) public HCDataModule getdatamodule(string odiname, String categoryname, Parameter[] parameters, boolean docompress,boolean forcerefresh) throws OZCPException public HCDataModule getdatamodule(string odiname, String categoryname, Parameter[] parameters, boolean docompress, boolean forcerefresh, String[] invaliddataset, MaxRowsOfSet[] maxrows) throws OZCPException. Argument odiname categoryname parameters docompress forcerefresh invaliddataset maxrows Class Parameter(oz.dm.Parameter). - public String name : public String value : MaxRowsOfSet (oz.dm. MaxRowsOfSet). - SetSetName public void SetSetName(String v). GetSetName public String GetSetName() 92 FORCS Co., LTD

. SetMaxRow public void SetMaxRow(int v). GetMaxRow public int GetMaxRow(). HCDataModule(oz.dm.hc.HCDataModule) HCDataSet. HCDataSet BCDataSet OZ DataModule Streaming. - public final static String PARAMETERSET_NAME = "OZParam"; : - getdatasetnames public String[] getdatasetnames(). getdatasets public HCDataSet[] getdatasets(string name)... (length) 0. Argument name PrintInfo public void PrintInfo(PrintStream out) PrintStream. Argument out PrintStream FORCS Co., LTD 93

OZ API Developer's Guide (for Java) HCDataSet(oz.dm.hc) HCDataSet OZ DataModule Streaming.. - final public static int BYTEARRAY_DATA_SET = 0x1; final public static int UTF_DATA_SET = 0x2; final public static String BYTEARRAY_PROTOCOL_NAME = "ByteArraySet"; final public static String UTF_PROTOCOL_NAME = "UTFSet"; - getresultset public ResultSet getresultset(). Sample : ViewerSample.java package sample; import oz.framework.api.viewer; import oz.dm.parameter; import oz.dm.hc.hcdatamodule; import oz.framework.cp.ozcpexception; import oz.dm.maxrowsofset; import java.io.*; import org.apache.log4j.*; public class ViewerSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = "127.0.0.1"; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = "http://www.oz.com/oz/server"; //Servlet URL 94 FORCS Co., LTD

/**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default Viewer viewer = null; try { //* // Daemon viewer = new Viewer(IP, PORT, ID, PWD, false, false); /*/ // Servlet viewer = new Viewer(URL, ID, PWD, false, false); /**/ int ODI_FILE_TYPE = 10000; // ODI int OZR_FILE_TYPE = 20001; // OZR String ozrname = "test.ozr"; String odiname = "test.odi"; //ODI String sdmname = "test.sdm"; String categoryname = "/"; // Parameter[] param = new Parameter[0]; // boolean force = false; // boolean compress = false; // DM String[] invalidset = new String[0]; // MaxRowsOfSet[] mx = new MaxRowsOfSet[0]; // // SDM (gethcusdm) HCDataModule usdm = viewer.gethcusdm(sdmname, categoryname); //. (getbytearrayform) byte[] formbytes = viewer.getbytearrayform(ozrname, categoryname); // (getform) InputStream in = viewer.getform(ozrname, categoryname, compress); // //(getuserparameterswithdefaultvalue) param = viewer.getuserparameterswithdefaultvalue(odiname, ODI_FILE_TYPE, categoryname); // Input Stream SDM (getdatamodule) HCDataModule sdm = viewer.getdatamodule( new FileInputStream(sdmName)); // (getdatamodules) HCDataModule dmodule = viewer.getdatamodule( odiname, categoryname, param, compress, force); FORCS Co., LTD 95

OZ API Developer's Guide (for Java) // (getdatamodules) HCDataModule dmodule2 = viewer.getdatamodule( odiname, categoryname, param,compress, force, invalidset, mx); catch (Exception e) { e.printstacktrace(); 96 FORCS Co., LTD

API Class Program Class Publisher Class Scheduler FORCS Co., LTD 97

OZ API Developer's Guide (for Java) API. API. Program Publisher Scheduler... API. ozsfw35.jar log4.jar Scheduler server. Server Log. (API classpath "log4.jar" ) 98 FORCS Co., LTD

Constructor Summary Program(String ip, int port) Method Summary void createfolder(serverinfo s, String folder) byte[] downloadfile(serverinfo s, String file) FileInfo[] getexternalprogramlist(serverinfo s, String folder) void removefiles(serverinfo s, String folder, String[] files) void removefolder(serverinfo s, String folder, boolean isall) void uploadfile(serverinfo s, String file, byte[] b) Constructor Detail public Program(String ip, int port) throws SchedulerException Argument ip port IP ex) String ip = "127.0.0.1"; (:9521) ex) int port = 9521; Method Detail createfolder public void createfolder(serverinfo s, String folder) throws SchedulerException. FORCS Co., LTD 99

OZ API Developer's Guide (for Java) Argument s folder downloadfile public byte[] downloadfile(serverinfo s, String file) throws SchedulerException. Argument s file getexternalprogramlist public FileInfo[] getexternalprogramlist(serverinfo s, String folder) throws SchedulerException. Argument s folder removefiles public void removefiles(serverinfo s, String folder, String[] files) throws SchedulerException. Argument s folder files removefolder public void removefolder(serverinfo s, String folder, boolean isall) throws SchedulerException. Argument s folder isall true : ( ) false : ( ) 100 FORCS Co., LTD

uploadfile public void uploadfile(serverinfo s, String file, byte[] b) throws SchedulerException (). Argument s file b Class SchedulerException(oz.scheduler.SchedulerException) Exception. ServerInfo(oz.scheduler.ServerInfo). - setisdaemon public final void setisdaemon(boolean isdaemon). Argument isdaemon Daemon true : Daemon false : Servlet setip public final void setip(string ip) IP. Server Daemon. Argument ip IP setportno public final void setportno(int portno) Port. Server Daemon. FORCS Co., LTD 101

OZ API Developer's Guide (for Java) Argument portno Port seturl public final void seturl(string url) throws IllegalArgumentException URL. Server Servlet. Argument url URL URL, 'http://'. setid public final void setid(string id) ID. Argument id ID setpwd public final void setpwd(string pwd). Argument pwd FileInfo(oz.scheduler.FileInfo.class) (/,,, ). - public boolean isdirectory : () public String name : public long size : public long lastmodified :, 1970 1 1 00:00:00 GMT 102 FORCS Co., LTD

Sample : ProgramSample.java package sample; import oz.scheduler.serverinfo; import oz.scheduler.fileinfo; import oz.framework.api.program; import org.apache.log4j.*; public class ProgramSample { public static void main(string[] args) { //. BasicConfigurator.configure(); String IP = "127.0.0.1"; // IP int PORT = 9521; // TCP Program program = null; try { program = new Program(IP, PORT); // ServerInfo serverinfo = new ServerInfo(); serverinfo.setid("admin"); // serverinfo.setpwd("admin"); // serverinfo.setip(ip); //OZ Server IP. daemon serverinfo.setisdaemon(true); //OZ Server daemon, servlet serverinfo.setportno(8003); /* OZ Server Port.daemon * s.seturl(null);//oz Server URL. * URL, //'http://' *. Server Servlet Type.*/ // (createfolder) String foldername = "testfolder"; // program.createfolder(serverinfo, foldername); // (uploadfile) String filename = "testprogram.bat"; // byte [] filebytes = filename.getbytes(); program.uploadfile(serverinfo, foldername+"/"+filename, filebytes); // (downloadfile) String downfilename = "testprogram.bat";// byte bytesarray[] = FORCS Co., LTD 103

OZ API Developer's Guide (for Java) program.downloadfile(serverinfo, foldername+"/"+downfilename); // (getexternalprogramlist) FileInfo fileinfo[] = program.getexternalprogramlist(serverinfo, foldername); for(int i=0;i<fileinfo.length;i++){ FileInfo fi = fileinfo[i]; System.out.println(i); System.out.println(" isdirectory " + fi.isdirectory); System.out.println(" name " + fi.name); System.out.println(" size " + fi.size); System.out.println(" lastmodified " + fi.lastmodified); System.out.println(); // (removefiles) // () String. String file1 = "testprogram.bat"; String file2 = "testprogram2.bat"; String [] files = new String[]{file1 ; //. program.removefiles(serverinfo, foldername, files); // (removefolder) boolean isall = true; // String foldernametoremove = "testfolder"; //. program.removefolder(serverinfo, foldernametoremove, isall); catch(exception e) { e.printstacktrace(); 104 FORCS Co., LTD

Constructor Summary Publisher(String ip, int port) Method Summary void createfolder(serverinfo s, String folder) byte[] downloadfile(serverinfo s, String file) FileInfo[] getpublishedfiles(serverinfo s, String folder) void removefiles(serverinfo s, String folder, String[] files) void removefolder(serverinfo s, String folder, boolean isall) Constructor Detail public Publisher(String ip, int port) throws SchedulerException Argument ip port IP ex) String ip = "127.0.0.1"; (:9521) ex) int port = 9521; Method Detail createfolder public void createfolder(serverinfo s, String folder) throws SchedulerException. FORCS Co., LTD 105

OZ API Developer's Guide (for Java) Argument s folder downloadfile public byte[] downloadfile(serverinfo s, String file) throws SchedulerException. Argument s file getpublishedfiles public FileInfo[] getpublishedfiles(serverinfo s, String folder) throws SchedulerException. Argument s folder removefiles public void removefiles(serverinfo s, String folder, String[] files) throws SchedulerException. Argument s folder fiels removefolder public void removefolder(serverinfo s, String folder, boolean isall) throws SchedulerException. Argument s folder isall true : ( ) false : ( ) 106 FORCS Co., LTD

Class ServerInfo(oz.scheduler.ServerInfo) Program class " class". FileInfo(oz. scheduler.fileinfo.class) Program class " class". Sample : PublisherSample.java package sample; import oz.framework.api.publisher; import oz.scheduler.fileinfo; import oz.scheduler.serverinfo; import org.apache.log4j.*; public class PublisherSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = "127.0.0.1"; // IP int PORT = 9521; // TCP Publisher publisher = null; try { publisher = new Publisher(IP, PORT); // ServerInfo serverinfo = new ServerInfo(); serverinfo.setid("admin"); // serverinfo.setpwd("admin"); // serverinfo.setip(ip); //OZ Server IP. daemon serverinfo.setisdaemon(true); //OZ Server.daemon, servlet serverinfo.setportno(8003); /* OZ Server Port.daemon * s.seturl(null);//oz Server URL. * URL, //'http://' *. Server Servlet Type.*/ FORCS Co., LTD 107

OZ API Developer's Guide (for Java) // (createfolder) String foldername = "excel"; // //publisher.createfolder(serverinfo, foldername); // (downloadfile) String filename = "customer.xls"; // byte bytesarray[] = publisher.downloadfile(serverinfo, filename); // (getpublishedfiles) FileInfo fileinfolist[] = publisher.getpublishedfiles(serverinfo, foldername); for(int i=0; i<fileinfolist.length; i++) { FileInfo fi = fileinfolist[i]; System.out.println(i); System.out.println(" isdirectory="+fi.isdirectory); System.out.println(" name="+fi.name); System.out.println(" size="+fi.size); System.out.println(" lastmodified="+fi.lastmodified); System.out.println(); // (removefiles) // () String. // customer.xls orderinfo.xls String file1 = "customer.xls"; String file2 = "orderinfo.xls"; String testfoldername = "excel"; String [] filestoremove = new String[]{file1, file2; // publisher.removefiles(serverinfo, testfoldername, filestoremove); // boolean isall = true;// String foldernametoremove = "excel";//.. publisher.removefolder(serverinfo, foldernametoremove, isall); catch(exception e) { 108 FORCS Co., LTD

Constructor Summary scheduler(string ip, int port) Method Summary void createtask(serverinfo s, SortProperties configmap, SortProperties exportmap) Vector gettask(serverinfo s) public TaskResult[] gettaskresult(serverinfo s, String from, String to, String taskid) throws SchedulerException SortProperties[] gettaskproperties(serverinfo info, String taskid) void removetask(serverinfo s, String task) String modifytask(serverinfo s, String taskid, SortProperties p, SortProperties exportmap) boolean taskpause(serverinfo s, String task) boolean taskresume(serverinfo s, String task) void stop(serverinfo s, boolean waittask) public boolean export(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException boolean makepdf(serverinfo s, SortProperties configmap, SortProperties exportmap) public boolean print(serverinfo s, SortProperties configmap, SortProperties printmap) throws SchedulerException SortProperties getconfiguration(serverinfo s) void modifyconfiguration(serverinfo s, SortProperties configmap, SortProperties exportmap) FORCS Co., LTD 109

OZ API Developer's Guide (for Java) Constructor Detail ppublic scheduler(string ip, int port) Argument ip port IP ex) String ip = "127.0.0.1"; (:9521) ex) int port = 9521; Method Detail createtask public void createtask(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException. : CreateTask Thread param. Argument s configmap exportmap key "Option". key "Option". gettask public Vector gettask(serverinfo s) throws SchedulerException. Argument s gettaskresult 110 FORCS Co., LTD

public TaskResult[] gettaskresult(serverinfo s, String from, String to, String taskid) throws SchedulerException. Argument s from to taskid gettaskproperties Argument public SortProperties[] gettaskproperties(serverinfo s, String taskid) throws SchedulerException (configmap) (exportmap). s taskid removetask public void removetask(serverinfo s, String taskid) throws SchedulerException. Argument s taskid modifytask public String modifytask(serverinfo s, String taskid, SortProperties configmap, SortProperties exportmap) throws SchedulerException. Argument s taskid configmap key "Option". FORCS Co., LTD 111

OZ API Developer's Guide (for Java) exportmap key "Option". taskpause public boolean taskpause(serverinfo s, String taskid) throws SchedulerException. Argument s taskid taskresume public boolean taskresume(serverinfo s, String taskid) throws SchedulerException. Argument s taskid stop public void stop(serverinfo s, boolean waittaskid) throws SchedulerException. Argument s waittaskid export public boolean export(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException. : "ViewType=None". :.pdf,.ozd,.html,.jpg,.xls,.doc,.svg,.txt,.ppt,.tif, csv. 112 FORCS Co., LTD

Argument s configmap exportmap key "Option". key "Option". : export API COM ASP "Appendix 1. SchedulerCOM ". makepdf public boolean makepdf(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException PDF. : "ViewType=None". Argument s configmap exportmap key "Option". creattask() PDF. PDF key "Option". creattask() PDF. : makepdf API COM ASP "Appendix 1. SchedulerCOM ". print public boolean print(serverinfo s, SortProperties configmap, SortProperties printmap) throws SchedulerException FORCS Co., LTD 113

OZ API Developer's Guide (for Java). ( ) : "task_type=viewertag". "ViewType=None". s Argument configmap exportmap key "Option". key "Option"., print.mode = silent. : print API, print API. getconfiguration public SortProperties getconfiguration(serverinfo s) throws SchedulerException. Argument s modifyconfiguration public void modifyconfiguration(serverinfo s, SortProperties configmap) throws SchedulerException. Argument s configmap key "Option". 114 FORCS Co., LTD

Class ServerInfo(oz.scheduler.ServerInfo) Program class " class". SortProperties (oz.util.sortproperties) Cache class " class". TaskResult(oz.scheduler.TaskResult). - public String taskid: ID public String completedtime : public int issuccessfulcode: public String issuccessful: public String formfilename: public String Parameter: public String schedulingtype: public String exportfilelist: public String errormsg: Option - "ViewType" "None", API, OZD. -,. applet.mode viewer.mode applet.useprogressbar export export false FORCS Co., LTD 115

OZ API Developer's Guide (for Java) viewer.useprogressbar applet.allowmultiframe viewer.allowmultiframe export.mode export.confirmsave information.debug applet.showerrormessage viewer.showerrormessage false true true silent false debug false false - Key Value report_name category_name ex) setproperty("report_name", "crosstab") ex) setproperty("category _name", "temp") - Key Value dm_server_check dm_server_name odi_name odi_category_name "check" "null" SDM ODI ex) setproperty("dm_server_check", "check") (Repository odi category SDM ) ex) setproperty("dm_server_name", test1.sdm") ODI ex) setproperty("odi_name","testodi.odi") ODI ( "/" ) ex) setproperty("odi_category_name","/test") - Key Value 116 FORCS Co., LTD

task_type "viewertag",. "SchedulerViewerTagSample.java". ex) setproperty("task_type ", "viewertag") - Key Value external_program_che ck external_program_co mmand "check" "null" ex) setproperty("external_program_check", "check") ("SCH_HOME/External" ) ex) SetProperty("external_program_command", "notepad.bat") Key Value mail_check mail_notify_error_ch eck mail_recipient_to mail_recipient_cc "check" "null" "check" "null" ex) setproperty("mail_check", "check") ex) setproperty("mail_notify_error_check", "null") ex) setproperty("mail_recipient_to", "gil_dong@forcs.com") ex) setproperty("mail_recipient_cc", "aaa@forcs.com") mail_recipient_bcc ex) setproperty("mail_recipient_bcc", "bbb@forcs.com") FORCS Co., LTD 117

OZ API Developer's Guide (for Java) mail_subject mail_text_message mail_html_comment html_mail_content mail_attach_list "check" "null" "check" "null" ex) setproperty("mail_subject", "") ex) setproperty("mail_text_message", "") HTML ex) setproperty("mail_html_comment","check") HTML ex) setproperty("html_mail_content","check") ( '/' ) ex) setproperty("mail_attach_list","excel/pdf/word") Key Value file_export_list ( '/' ) ex) setproperty("file_export_list ", "xls/pdf/tif" Key Value parameter_count ex) setproperty("parameter_count", "1") parameter_name_1... parameter_name_n (n : ) ex) setproperty("parameter_name_1", "[FORM].empNo") parameter_value_1... parameter_value_n (n : ) ex) setproperty("parameter_value_1", " 10") : ODI,. 118 FORCS Co., LTD

"[FORM].". empno "[FORM].empNo". ODI ODI. ODI "testodi" "id" "testodi.id". ODI Key Value odi_parameter_ count ex) setproperty("odi_parameter_count", "1") odi_parameter_name_1... odi_parameter_name_n (n : ) ex) setproperty("odi_parameter_name_1", "id") odi_parameter_value_1... odi_parameter_value_n (n : ) ex) setproperty("odi_parameter_value_1", " 10") : ODI, ODI ODI. - Key Value launch_type "once" "immediately" "periodically" once : immediately : periodically : ex) setproperty("launch_type", "once") launch_ type = once Key Value FORCS Co., LTD 119

OZ API Developer's Guide (for Java) execution_year execution_month execution_day execution_hour execution_min ex) setproperty("execution_year", "2005") ex) setproperty("execution_month", "12") ex) setproperty("execution_day", "30") ex) setproperty("execution_hour", "10") ex) setproperty("execution_minute", "30") launch_ type = periodically Key Value start_year start_month start_day periodically_executi on_day_type "daily" "weekly" "monthly" ex) setproperty("start_year", "2002") ex) setproperty("start_month", "11") ex) setproperty("start_day", "16") ex) setproperty("periodically_execution_day_ type", "daily") periodically_ execution_day_type = daily Key Value daily_type daily_every_days weekday ex) setproperty("daily_type", "weekday") () ex) 2 : setproperty ("daily_every_days", "2") periodically_ execution_day_type = weekly Key Value weekly_every_week s ex) setproperty("weekly_every_weeks", "2") 120 FORCS Co., LTD

weekly_monday_che ck weekly_tuesday_che ck weekly_wednesday_ check weekly_thursday_ch eck weekly_friday_check weekly_saturday_ch eck weekly_sunday_che ck "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" ex) setproperty("weekly_monday_check", "check") ex) setproperty("weekly_tuesday_check", "check") ex) setproperty("weekly_wednesday_check", "check") ex) setproperty("weekly_thursday_check", "check") ex) setproperty("weekly_friday_check", "check") ex) setproperty("weekly_saturday_check", "check") ex) setproperty("weekly_sunday_check", "check") periodically_ execution_day_type = monthly Key Value monthly_every_m onths monthly_type monthly_days monthly_which_w eek "specific_day", "day_of_week", "user_defined" "T1" "T2" "T3"" T4" "T5" ( ) ex) setproperty("monthly_every_months", "2") ex) setproperty("monthly_type", "specific_day") ex) setproperty("monthly_days", "2") T1 : T2 : T3 : T4 : T5 : ex) setproperty("monthly_which_week", "T2") FORCS Co., LTD 121

OZ API Developer's Guide (for Java) monthly_which_w eek_day monthly_user_defi ned_days "sunday" "monday" "tuesday" "wednesday" "thursday" "friday" "saturday" ex) : setproperty("monthly_which_week_day", "monday") (,) ex) 1,15 : setproperty("monthly_user_defined_days", "1,15") - Key Value periodically_exec ution_time_ type "once" "repeat" "user_defined" (,, ) ex) setproperty ("periodically_execution_time_type","once") periodically_ execution_time_ type = once Key Value once_hour once_min ex) setproperty("once_hour", "01") ex) setproperty("once_min", "00") periodically_ execution_time_ type = repeat Key Value repeat_every_hours repeat_every_minutes repeat_start_hour repeat_start_minute ex) setproperty("repeat_every_hours", "01") ex) setproperty("repeat_every_minutes", "04") ex) setproperty("repeat_start_hour", "02") ex) setproperty("repeat_start_minute", "05") 122 FORCS Co., LTD

repeat_end_hour repeat_end_minute ex) setproperty("repeat_end_hour", 09") ex) setproperty("repeat_end_minute", "35") : 6 2 5 9 35 1 4. periodically_ execution_time_ type = user_defined Key Value user_defined_time (:) (,) ex) setproperty("user_defined_time", "01:30,13:30") CSV Key Value csv.filename csv.pagetitle csv.pageline csv.pagestyle csv.separator "page" "none" "# <page>" "# <page> -- -" "--- #<page>" "<page> #" "Tab" "Space" "Comma" CSV ex) setproperty("csv.filename","test.csv") ex) setproperty("csv.pagetitle", "<<Page>>") ex) setproperty("csv.pageline ", "7") (:none - ) ex) setproperty("csv.pagestyle", "none") CSV ex) setproperty("csv.separator", "Tab") FORCS Co., LTD 123

OZ API Developer's Guide (for Java) csv.removerange csv.exceptfirstpage csv.savetointeger "true" "false" "true" "false" (", " ) ex) setproperty("csv.removerage", "1, 3") true : false : () ex) setproperty("csv.exceptfirstpage", "true") true : false : () ex) setproperty("csv.savetointeger", "true") Excel Key Value Excel.filename ex) setproperty("excle. filename ", "test.xls") Excel.numberfor mat Excel.savefont Excel.matchmode Excel.matchsubm ode excel.removeran ge "columnpersheet" "paperpersheet" "RowFirst" "ColumnFirst" ex) setproperty("excel.numberformat ", "#,##0.00") ex) setproperty("excel.savefont", "Arial, Courier") columnpersheet : Sheet () paperpersheet : Sheet ex) setproperty("excel.matchmode", "columnpersheet") (:RowFirst) ex) setproperty("excel.matchsubmode", "rowfirst") (", " ) ex) setproperty("excel.removerange", "1,3") 124 FORCS Co., LTD

excel.removeopti on "FirstPageOnly" "FirstPageExcept" "AllPage" excel.removerange FirstPageOnly : FirstPageExcept: AllPage : () ex) setproperty("excel.removeoption", "AllPage") excel.removeblan k "true" "false" (:false) ex) setproperty("excel.removeblank", "Yes") HTML Key Value html.filename HTML ex) setproperty("html.filename", "test.html") html.imagepath Html (URL ) ex) setproperty("html.imagepath","file://c:/image"); html.vertical (:) ex) setproperty("html.vertical","1") html.horizontal (:) ex) setproperty("html.horizontal","1") html.savebypage "true" "false" HTML true : false : () ex) setproperty("html.savebypage","true") html.offsetx x (:) ex) setproperty("html.offsetx","1") html.offsety y (:) ex) setproperty("html.offsety","1") FORCS Co., LTD 125

OZ API Developer's Guide (for Java) Jpeg Key Value jpg.filename JPEG ex) setproperty("jpg.filename", "test.jpg") OZD Key Value ozd.filename ozd.memoallowe d ozd.saveall ozd.password "true" "false" "true" "false" OZD ex) setproperty("ozd. filename ", "test.ozd") true : () false : ex) setproperty("ozd. memoallowed ", "true") : Direct true : () false : ex) setproperty("ozd.saveall ", "true") ex) setproperty("ozd.password", "admin") PDF Key Value pdf.filename PDF ex) setproperty("pdf.filename", "test.pdf") pdf.saverange pdf.title pdf.subject pdf.creator (", " ) ex) setproperty("pdf.saverange ", "1.3") PDF ex) setproperty("pdf.title", "Report") PDF ex) setproperty("pdf.title", "Report") ex) setproperty("pdf.creator", "Forcs") 126 FORCS Co., LTD

pdf.author pdf.keyword pdf.userpasswor d pdf.masterpassw ord ex) setproperty("pdf.author", "Forcs") PDF ex) setproperty("pdf.keyword", "oz") PDF ex) setproperty("pdf.userpassword", "user") PDF ex) setproperty("pdf.masterpassword", "admin") pdf.printable PDF (:true) ex) setproperty("pdf.printable", "true") PPT Key Value ppt.filename PPT ex) setproperty("ppt.filename", "test.ppt") SVG Key Value svg.filename SVG ex) setproperty("svg.filename", "test.svg") Text Key Value text.filename text.pagetitle text.pageline "page" Text ex) setproperty("text.filename","test.txt") ex) setproperty("csv.pagetitle", "<<Page>>") ex) setproperty("text.pageline ", "7") FORCS Co., LTD 127

OZ API Developer's Guide (for Java) text.pagestyle "none" "# <page>" "# <page> ---" "--- #<page>" "<page> #" (:none - ) ex) setproperty("text.pagestyle", "none") text.separator "Tab" "Space" "Comma" Text ex) setproperty("text.separator", "Tab") text.removerage (", " ) ex) setproperty("text.removerage", "1, 3") text.exceptfirstp age text.savetointege r "true" "false" "true" "false" true : false : () ex) setproperty("text.exceptfirstpage", "true") true : false : () ex) setproperty("text.savetointeger", "true") Tiff Key Value tiff.filename tiff.encode "G3" "G4" Tiff ex) setproperty("tiff.filename", "test.tif") Tiff G3: fax G3 Tiff () G4 : fax G4 Tiff ex) setproperty("tiff.encode", "G3") Word Key Value word.filename ex) setproperty("word.filename", "test.doc") 128 FORCS Co., LTD

Value "/." "%%\Repository/"., "FORCS" CSV setproperty("csv.filename", "FORCS/test.csv"), "%%\Repository/FORCS" "test.csv". modifyconfiguration ConfigMap Key Value SchedulerPort SchedulingInfoFil epath SMTPServer ( : "9521") ex) p.setproperty("schedulerport", "9521"); ex) p.setproperty("schedulinginfofilepath","%sch_hom E%/ScheduledTask"); SMTP ex) p.setproperty("smtpserver", "mail.forcs.com"); SMTPServerProt SMTP ex) p.setproperty("smtpserverprot", "25"); MailFrom TempRepositoryF ilepath ex) p.setproperty("mailfrom", "mail@forcs.com"); ex) p.setproperty("temprepositoryfilepath", "%SCH_HOME%/Te mp Repository"); RepositoryFileRo otpath ex) p.setproperty("repositoryfilerootpath", "%SCH_HOME%/Repository"); ExternalProgram FilePath ErrorNotifyToSen der "true" "false" ex) p.setproperty("externalprogramfilepath", "%SCH_HOME%/External"); true : false : ex) p.setproperty("errornotifytosender", "false"); FORCS Co., LTD 129

OZ API Developer's Guide (for Java) Sample : SchedulerSample.java package sample; import oz.framework.api.*; import oz.scheduler.taskresult; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; import oz.util.sortproperties; import java.util.vector; import java.io.*; import org.apache.log4j.*; public class SchedulerSample { private static String[][] mailrelatedproperties = { // {"report_name", "test.ozr",// {"category_name","/", // {"cfg.type","new", // Task new, edit // {"odi_name","testodi.odi", {"odi_category_name","/test", {"dm_server_check", "check", // {"dm_server_name", "test1.sdm",// // {"odi_name","testodi.odi", // odi {"odi_category_name","/test",// odi {"external_program_check", "check", {"external_program_command", "notepad.bat", //. // {"parameter_count", "1", // {"parameter_name_1", "[FORM].empNo", // {"parameter_value_1", "10", // // ODI {"odi_parameter_count", "1", // {"odi_parameter_name_1", "id", // {"odi_parameter_value_1", "12",// // 130 FORCS Co., LTD

{"launch_type", "once", //("immediately","periodically") {"execution_year", "2003",//- {"execution_month", "12", //- {"execution_day", "17", //- {"execution_hour", "10", //- {"execution_min", "30", //- {"periodically_execution_day_type","daily", //("weekly", "monthly") {"daily_type", "weekday", //("specific_day") {"periodically_execution_time_type", "once", // ( "repeat", "user_defined") {"once_hour", "01", // - {"once_min", "00", // - ; // {"mail_check", "check", //- {"html_mail_content", "check", // html {"mail_notify_error_check", "null", // - {"mail_recipient_to", "gil_dong@forcs.com", // {"mail_recipient_cc", "abc@forcs.com", // {"mail_recipient_bcc", "lan@forcs.com",// {"mail_subject", "", // {"mail_text_message", "", // {"mail_attach_list", "csv/excel/html/ozd/pdf/text/tiff/word/ppt/jpg/svg", // {"file_export_list", "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg" // Export private static String[][] attachrelatedproperties = { // CSV {"csv.filename ", "test.csv", // csv {"csv.pagetitle ", "page", // {"csv.pageline ", "7", // {"csv.pagestyle", "none", // {"csv.separator ", "Tab", // CSV {"csv.removerange ", "1,3", // CSV {"csv.exceptfirstpage ", "true",// {"csv.savetointeger ", "true", // // {"excel.filename ", "test.xls", // excel {"excel.numberformat ", "#,##0.00",// {"excel.savefont", "Arial", // FORCS Co., LTD 131

OZ API Developer's Guide (for Java) {"excel.matchmode", "columnpersheet", // {"excel.matchsubmode", "rowfirst", // {"excel.removerange", "1,3", // {"excel.removeoption ", " firstpageonly", // {"excel.removeblank ", " true", // // html {"html.filename ", "test.html", // html {"html.imagepath ", "file://c:/image", // html {"html.vertical ", "1", // html {"html.horizontal ", "1", // html {"html.savebypage ", "true", // html {"html.offsetx ", "1", // x offset {"html.offsety ", "1", // y offset // ozd {"ozd.filename ", "test.ozd", //OZD {"ozd.memoallowed ", "true", // {"ozd.password", "admin", // ozd // pdf {"pdf.filename ", "test.pdf", //pdf {"pdf.saverange ", "1.3", //pdf {"pdf.title ", "Report", //pdf {"pdf.subject ", "OZ", //pdf {"pdf.creator ", "hong", //pdf {"pdf.author ", "hong", //pdf {"pdf.keyword ", "oz", //pdf {"pdf.userpassword", "user", //pdf {"pdf.masterpassword ", "admin",//pdf {"pdf.printprotected ", "true", //pdf // text {"text.filename ", "test.txt", //text {"text.pagetitle ", "page", // {"text.pageline ", "7", // {"text.pagestyle", "none", // {"text.separator ", "Tab", //text {"text.removerange ", "1,3", //text {"text.exceptfirstpage ", "true", // {"text.savetointeger ", "true", // // Tiff {"tiff.filename ", "test.tif",//tiff {"tiff.encode ", "G3", //tiff 132 FORCS Co., LTD

// word {"word.filename ", "test.doc", //word // ppt {"ppt.filename ", "test.ppt ", //ppt // jpg {"jpg.filename ", "test.jpg ", //jpg ; // svg {"svg.filename ", "test.svg" //svg private static String[][] schedulerrelatedproperties = { {"SchedulerPort", "9521", // {"schedulerserver", "%SCH_HOME%/ScheduledTask", // {"SMTPServer", "mail.forcs.com", //SMTP {"SMTPServerPort", "25", //SMTP {"MailFrom", "kil_dong@forcs.com",// {"TempRepositoryFilePath", "%SCH_HOME%/TempRepository", // {"RepositoryFileRootPath", "%SCH_HOME%/Repository", //PDF {"ExternalProgramFilePath", "%SCH_HOME%/External", // {"ErrorNotifyToSender", "false" // ; public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = "127.0.0.1"; // IP int PORT = 9521; // TCP String[][] values = null; Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); // ServerInfo serverinfo = new ServerInfo(); serverinfo.setid("admin"); // serverinfo.setpwd("admin"); // FORCS Co., LTD 133

OZ API Developer's Guide (for Java) serverinfo.setip(ip); //OZ Server IP. daemon serverinfo.setisdaemon(true); //OZ Server.daemon, servlet serverinfo.setportno(8003); /* OZ Server Port.daemon * s.seturl(null);//oz Server URL. * URL, //'http://' *. Server Servlet Type.*/ // (createtask) // //. //check, uncheck "check", "null". SortProperties props = new SortProperties(); setproperties(props, mailrelatedproperties); SortProperties exportmap = new SortProperties(); setproperties(exportmap, attachrelatedproperties); scheduler.createtask(serverinfo, props, exportmap); scheduler.makepdf(serverinfo, props, exportmap); scheduler.makepdfbypooling(serverinfo, props, exportmap); // (modifyconfiguration) SortProperties pro = new SortProperties(); setproperties(pro, schedulerrelatedproperties); scheduler.modifyconfiguration(serverinfo, pro); // (getconfiguration) pro = scheduler.getconfiguration(serverinfo); pro.list(system.out); /* * (gettask) * *, *. */ ScheduledTask stask = new ScheduledTask(); // setting stask.taskid = "parameter_test.ozs"; // stask.reportname = "/parameter_test"; // stask.schedulingtypestr = "Periodically"; // stask.lastruntimestr = ""; // stask.nextruntimestr = "2005-06-08 19:00";// stask.status = 'W'; //(WAITING,RUNNING,PAUSE.) 134 FORCS Co., LTD

ScheduledTask[] tasklist = scheduler.gettask(serverinfo); for (int i = 0; i < tasklist.length; i++) { showtask(tasklist[i]); /* * (gettaskresult) * *, *. */ // TaskResult tr = new TaskResult(); tr.taskid = "parameter_test.ozs"; // tr.completedtime = "2005-06-08 19:00"; // tr.issuccessful = "true"; // tr.formfilename = "/parameter_test"; // tr.paraminfo = "0{"; // tr.schedulingtype = "Periodically"; // //-. //. tr.errormsg = "Fail to execute scheduling task with OZServer. :"; String from = "2005-06-08"; // String to = "2005-06-30"; // TaskResult[] trlist = scheduler.gettaskresult(serverinfo, from, to, tr.taskid); for (int i = 0; i < trlist.length; i++) { showtaskresult(trlist[i]); String task = stask.taskid; // // (taskpause) boolean b = scheduler.taskpause(serverinfo, task); // (taskresume) boolean bool = scheduler.taskresume(serverinfo, task); // (removetask) scheduler.removetask(serverinfo, task); //.(stop) boolean waittask = true; // boolean scheduler.stop(serverinfo, waittask); catch(exception e) { e.printstacktrace(); FORCS Co., LTD 135

OZ API Developer's Guide (for Java) private static void setproperties(sortproperties p, String[][] values) { for(int i=0; i<values.length; i++) { p.setproperty(values[i][0], values[i][1]); private static void showtask(scheduledtask t) { System.out.println(" " + t.taskid); System.out.println(" " + t.reportname); System.out.println(" " + t.schedulingtypestr); System.out.println(" " + t.lastruntimestr); System.out.println(" " + t.nextruntimestr); System.out.println(" " + t.status); System.out.println(""); private static void showtaskresult(taskresult tr) { System.out.println(" " + tr.taskid); System.out.println(" " + tr.completedtime); System.out.println(" " + tr.issuccessful); System.out.println(" " + tr.formfilename); System.out.println(" " + tr.paraminfo); System.out.println(" " + tr.schedulingtype); System.out.println(" : " + tr.exportfilelist); System.out.println(" " + tr.errormsg); System.out.println(""); Sample : SchedulerViewerTagSample.java package sample; import oz.framework.api.*; import oz.scheduler.taskresult; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; import oz.util.sortproperties; import java.util.vector; import java.io.*; import org.apache.log4j.*; import oz.scheduler.schedulerexception; 136 FORCS Co., LTD

public class SchedulerViewerTagSample { public static void main(string[] args) throws SchedulerException { //. BasicConfigurator.configure(); Scheduler scheduler = null; scheduler = new Scheduler("127.0.0.1", 9521); // ServerInfo serverinfo = new ServerInfo(); serverinfo.setid("admin"); // serverinfo.setpwd("admin"); // serverinfo.setisdaemon(true); serverinfo.setip("127.0.0.1"); //OZ Server IP. daemon serverinfo.setportno(8003); SortProperties config = new SortProperties(); //. config.setproperty("task_type", "viewertag"); // Task new, edit config.setproperty("cfg.type", "new"); // (:"immediately", :"periodically") config.setproperty("launch_type", "immediately"); SortProperties export = new SortProperties(); // export.setproperty("connection.server", "127.0.0.1"); export.setproperty("connection.port", "8003"); export.setproperty("connection.reportname", "/parameter_test.ozr"); export.setproperty("applet.mode", "export"); export.setproperty("applet.useprogressbar", "false"); export.setproperty("applet.allowmultiframe", "true"); export.setproperty("connection.pcount", "2"); export.setproperty("connection.args1", "formparam1="); export.setproperty("connection.args2", "formparam2="); export.setproperty("export.mode", "silent"); // export.setproperty("export.saveonefile", "true"); export.setproperty("connection.fetchtype", "BATCH"); export.setproperty("export.confirmsave", "false"); export.setproperty("information.debug", "debug"); export.setproperty("applet.showerrormessage", "false"); FORCS Co., LTD 137

OZ API Developer's Guide (for Java) export.setproperty("odi.parameter_test.pcount", "2"); export.setproperty("odi.parameter_test.args1", "odiparam1="); export.setproperty("odi.parameter_test.args2", "odiparam2="); export.setproperty("odi.odinames", "parameter_test"); export.setproperty("export.format", "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg"); export.setproperty("csv.filename", "1.csv"); export.setproperty("excel.filename", "1.xls"); export.setproperty("html.filename", "1.html"); export.setproperty("ozd.filename", "1.ozd"); export.setproperty("pdf.filename", "1.pdf"); export.setproperty("text.filename", "1.txt"); export.setproperty("tiff.filename", "1.tif"); export.setproperty("word.filename", "1.doc"); export.setproperty("ppt.filename", "1.ppt"); export.setproperty("jpg.filename", "1.jpg"); export.setproperty("svg.filename", "1.svg"); // export.setproperty("viewer.childcount", "1"); export.setproperty("child1.connection.server", "127.0.0.1"); export.setproperty("child1.connection.port", "8003"); export.setproperty("child1.connection.reportname", "/parameter_test.ozr"); export.setproperty("child1.applet.mode", "export"); export.setproperty("child1.applet.useprogressbar", "false"); export.setproperty("child1.applet.allowmultiframe", "true"); export.setproperty("child1.export.mode", "silent"); export.setproperty("child1.connection.fetchtype", "BATCH"); export.setproperty("child1.export.confirmsave", "false"); export.setproperty("child1.information.debug", "debug"); export.setproperty("child1.applet.showerrormessage", "false"); export.setproperty("child1.connection.pcount", "2"); export.setproperty("child1.connection.args1", "formparam1= 1"); export.setproperty("child1.connection.args2", "formparam2= 2"); export.setproperty("child1.odi.odinames", "parameter_test"); export.setproperty("child1.odi.parameter_test.pcount", "2"); export.setproperty("child1.odi.parameter_test.args1", "odiparam1= 3"); export.setproperty("child1.odi.parameter_test.args2", "odiparam2= 4"); //. export.setproperty("child1.export.format", "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg"); export.setproperty("child1.csv.filename", "child_1.csv"); export.setproperty("child1.excel.filename", "child_1.xls"); export.setproperty("child1.html.filename", "child_1.html"); 138 FORCS Co., LTD

export.setproperty("child1.ozd.filename", "child_1.ozd"); export.setproperty("child1.pdf.filename", "child_1.pdf"); export.setproperty("child1.text.filename", "child_1.txt"); export.setproperty("child1.tiff.filename", "child_1.tif"); export.setproperty("child1.word.filename", "child_1.doc"); export.setproperty("child1.ppt.filename", "child_1.ppt"); export.setproperty("child1.jpg.filename", "child_1.jpg"); export.setproperty("child1.svg.filename", "child_1.svg"); // API EM. String taskid = scheduler.createtask(serverinfo, config, export); Sample : SchedulerTaskResult.java package sample; import oz.framework.api.*; import oz.scheduler.taskresult; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; public class SchedulerTaskResult { public static void main(string[] args) { String IP = "127.0.0.1"; //scheduler server ip int PORT = 9521; //scheduler server port Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); // scheduler Server Info ServerInfo serverinfo = new ServerInfo(); daemon serverinfo.setip("127.0.0.1"); //OZ Server IP conf. In case use of serverinfo.setportno(8003); serverinfo.setisdaemon(true);//oz Server Type. -> daemon, servlet serverinfo.setid("admin"); //id serverinfo.setpwd("admin"); //pw FORCS Co., LTD 139

OZ API Developer's Guide (for Java) ScheduledTask[] tasklist = scheduler.gettask(serverinfo); for (int k = 0; k < tasklist.length; k++) { showtask(tasklist[k]); System.out.println("\n\n"); TaskResult tr = new TaskResult(); tr.taskid = tasklist[k].taskid; String from = ""; //Task Result Start time String to = ""; //Task Result Endt time boolean iscomplete = false; TaskResult[] trlist = scheduler.gettaskresult(serverinfo, from, to, tr.taskid); if (trlist.length > 0) { for (int i = 0; i < trlist.length; i++) { showtaskresult(trlist[i]); iscomplete = true; catch(exception e) { e.printstacktrace(); private static void showtask(scheduledtask t) { System.out.println("TASK ID : " + t.taskid); System.out.println("Report Name : " + t.reportname); System.out.println("Type : " + t.schedulingtypestr); System.out.println("Finish Execute Time : " + t.lastruntimestr); System.out.println("Next Execute Time : " + t.nextruntimestr); System.out.println("Status : " + t.status); System.out.println(""); private static void showtaskresult(taskresult tr) { System.out.println("TASK ID : " + tr.taskid); System.out.println("TASK FINISH TIME : " + tr.completedtime); System.out.println("Is Sucessed Code : " + tr.issuccessfulcode); System.out.println("Is Sucessed? : " + tr.issuccessful); System.out.println("Report Name : " + tr.formfilename); 140 FORCS Co., LTD

System.out.println("Parameter : " + tr.paraminfo); System.out.println("Type : " + tr.schedulingtype); System.out.println("Error Message : " + tr.errormsg); System.out.println(""); Sample : SchedulerTaskModify.java package sample; import org.apache.log4j.*; import oz.framework.api.*; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; import oz.util.sortproperties; public class SchedulerTaskModify { public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = "127.0.0.1"; // IP int PORT = 9521; // Port Scheduler scheduler = null; String taskid = null; try { scheduler = new Scheduler(IP, PORT); // OZ Server ServerInfo serverinfo = new ServerInfo(); serverinfo.setip("127.0.0.1"); // IP serverinfo.setportno(8003); // Port serverinfo.setisdaemon(true);// serverinfo.setid("admin"); // ID serverinfo.setpwd("admin"); // Password // taskid FORCS Co., LTD 141

OZ API Developer's Guide (for Java). // task task_type viewertag taskid = "parameter_test_061031115221500_263141500.ozs"; taskid); //. SortProperties[] props = scheduler.gettaskproperties(serverinfo, // txt Export Task csv export. props[0].setproperty("user_defined_time", "17:53"); props[0].setproperty("file_export_list", "csv/txt"); props[1].setproperty("csv.filename", "modify_task.csv"); // System.out.println("config..."); props[0].list(system.out); System.out.println("export..."); props[1].list(system.out); // ScheduledTask[] tasklist = scheduler.gettask(serverinfo); for (int i = 0; i < tasklist.length; i++) { if (taskid.endswith(tasklist[i].taskid)) { while(true) { if (tasklist[i].status!= 'R') { // // scheduler.modifytask(serverinfo, taskid, props[0], props[1]); System.out.println("modify ok..."); break; Thread.sleep(1000); catch(exception e) { e.printstacktrace(); 142 FORCS Co., LTD

Sample : SchedulerPrint.java package sample; import org.apache.log4j.basicconfigurator; import oz.framework.api.scheduler; import oz.scheduler.schedulerexception; import oz.scheduler.serverinfo; import oz.util.sortproperties; public class SchedulerPrint { public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = "127.0.0.1"; // IP int PORT = 9521; // Port try { Scheduler scheduler = new Scheduler(IP, PORT); // OZ Server ServerInfo serverinfo = new ServerInfo(); serverinfo.setip("127.0.0.1"); // IP serverinfo.setportno(8003); // Port serverinfo.setisdaemon(true); // serverinfo.setid("admin"); // ID serverinfo.setpwd("admin"); // Password SortProperties config = new SortProperties(); // print task_type viewertag. config.setproperty("task_type", "viewertag"); config.setproperty("launch_type", "immediately"); SortProperties printmap = new SortProperties(); printmap.setproperty("connection.server", "127.0.0.1"); printmap.setproperty("connection.port", "8003"); printmap.setproperty("connection.reportname", "/parameter_test.ozr"); printmap.setproperty("repository_agent.try_license_check", "true"); printmap.setproperty("connection.pcount", "2"); printmap.setproperty("connection.args1", "formparam1="); printmap.setproperty("connection.args2", "formparam2="); printmap.setproperty("connection.fetchtype", "BATCH"); FORCS Co., LTD 143

OZ API Developer's Guide (for Java) printmap.setproperty("odi.parameter_test.pcount", "2"); printmap.setproperty("odi.parameter_test.args1", "odiparam1="); printmap.setproperty("odi.parameter_test.args2", "odiparam2="); printmap.setproperty("odi.odinames", "parameter_test"); //print ( ) printmap.setproperty("print.adjust", "true"); printmap.setproperty("print.alldocument", "false"); printmap.setproperty("print.close", "true"); printmap.setproperty("print.collate", "true"); printmap.setproperty("print.copies", "1"); printmap.setproperty("print.duplex", "none"); printmap.setproperty("print.gray", "true"); printmap.setproperty("print.ignoreerror", "true"); printmap.setproperty("print.lockopt", "true"); printmap.setproperty("print.once", "false"); printmap.setproperty("print.orientation", "default"); printmap.setproperty("print.pageorient", "horizontal"); printmap.setproperty("print.pagerange", "all"); printmap.setproperty("print.printbypage", "true"); printmap.setproperty("print.printername", "default"); printmap.setproperty("print.scaling", "100"); printmap.setproperty("print.size", "A4"); printmap.setproperty("print.spoolpages", "100"); printmap.setproperty("print.style", "normal"); printmap.setproperty("print.usedefaultpaper", "false"); printmap.setproperty("print.spoolpages", "100"); printmap.setproperty("print.usedialogopt", "true"); // printmap.setproperty("viewer.childcount", "1"); printmap.setproperty("child1.connection.server", "127.0.0.1"); printmap.setproperty("child1.connection.port", "8003"); printmap.setproperty("child1.connection.reportname", "/module_sample.ozr"); printmap.setproperty("child1.connection.fetchtype", "BATCH"); // API EM. scheduler.print(serverinfo, config, printmap); catch (SchedulerException se) { se.printstacktrace(); 144 FORCS Co., LTD

API OZLauncherDll FORCS Co., LTD 145

OZ API Developer's Guide (for Java) OZLauncherDll. Function Summary void_stdcall SetPath(LPCTSTR strpath) void_stdcall SetClassNameForJava(LPCTSTR strclassname) void_stdcall SetPackageNameForJava(LPCTSTR strpackages) void_stdcall SetMSViewerTypeForJava(int type) void_stdcall SetCommand(LPCTSTR strcommand) void_stdcall SetDataForJava(LPCTSTR strdata) BOOL_stdcall CreateOZViewer(LPCTSTR str_param, int n_type) LPCTSTR_stdcall GetResult() void_stdcall Release() Function Detail SetPath void_stdcall SetPath(LPCTSTR strpath). Argument strpath SetClassNameForJava void_stdcall SetClassNameForJava(LPCTSTR strclassname) Applet Main Class.( Applet ) Argument strclassname Main Class 146 FORCS Co., LTD

Example SetClassNameForJava("oz.application.OZIEApplication"); SetCommand("/string"); SetPackageNameForJava void_stdcall SetPackageNameForJava(LPCTSTR strpackages). [;].( Applet ). Argument strpackages Example SetPackageNameForJava("ozapp.zip; ozviewer.jar"); SetMSViewerTypeForJava void_stdcall SetMSViewerTypeForJava(int type) MS VM.( Applet ) Argument type 1 2. 1 Wjview. 2 Jview. SetCommand void_stdcall SetCommand(LPCTSTR strcommand). Argument strcommand Example SetCommand("/locale ko/kr /mode alone /slp true /launchstring"); SetDataForJava void_stdcall SetDataForJava(LPCTSTR strdata) Heavy client. SDM.( Applet ) Argument strdata CreateOZViewer BOOL_stdcall CreateOZViewer(LPCTSTR str_param, int n_type). true false. FORCS Co., LTD 147

OZ API Developer's Guide (for Java) Argument str_param n_type. "n". 2. Example CreateOZViewer("connection.server=127.0.0.1\n connection.port=8003\n connection.reportname=/ozsample.ozr\n", 2); GetResult LPCTSTR_stdcall GetResult() Export. Applet.printcommand Applet.exportcommand... - Return GetResult(). Export Print <oz export dlg> code path file name </oz export dlg> <oz printer> message code report name printer name print copy print pages print range user name </oz printer> code : 0 =, 1 = path : file name : message : code : 0 =, 1 = report name : printer name : print copy : print pages : print range : user name : Release() void stdcall Release().. 148 FORCS Co., LTD

Example SetCommand("/string"); SetPath("./"); CreateOZViewer("connection.server=127.0.0.1\n toolbar.all=true\n information.debug=debug\n information.bmt=true\n connection.port=8003\n connection.reportname=/ozsample.ozr\n connection.compressedform=true",1); result = GetResult(); Release(); FORCS Co., LTD 149

OZ API Developer's Guide (for Java) 150 FORCS Co., LTD

User Data Store UDS UDS UDS FORCS Co., LTD 151

OZ API Developer's Guide (for Java) UDS(User Data Store) Non-DB Java Interface, CSV, XML EJB, Servlet, ASP, JSP, Applet. 1 ----------------- Result Set OZ User Data Source Interface JDBC Driver ODBC Driver (, ) UDS ResultSet.. UDS SQL.. 152 FORCS Co., LTD

JDBC UDS. OZ Server OZ Designer Query String ResultSet JDBC Driver DBMS JDBC Driver DBMS JDBC Driver DBMS ResultSet. ResultSet Java JDBC java.sql.resultset Interface (implement)., DBMS DBMS JDBC Driver java.sql.resultset Interface Concrete ResultSet. JDBC Driver java.sql.resultset Interface. OZ Server OZ Designer () Custom ResultSet Custom JDBC Driver UDS(User Data Store) JDBC Driver Custom Driver java.sql.resultset interface ResultSet. JDBC Driver. oz.uds. UserDataStore Interface UserDataStore Interface ResultSet Interface. oz.uds.userdatastore interface 4. FORCS Co., LTD 153

OZ API Developer's Guide (for Java) package oz.uds; import java.sql.*; public interface OZUserDataStore { public void init() throws OZUserDataStoreException; public ResultSet getresultset(string argument) throws OZUserDataStoreException; public void freeresultset(resultset rst); public void close();. void init() ResultSet getresultset(string argument) void freeresultset(resultset rst) void close() UDS,. Argument() ResultSet. ResultSet, getresultset ResultSet. UDS,. : init(), close(). 154 FORCS Co., LTD

UDS getresultset. UDS Source UDS Main Argument. import oz.uds.*; import java.sql.resultset; public class Extdata implements OZUserDataStore{ public void init() throws OZUserDataStoreException { // UDS. DB. public ResultSet getresultset(string argument) throws OZUserDataStoreException { // Argument Resultset. // Argument OZ. public void freeresultset(resultset rst){ // getresultset ResultSet. // ResultSet Close. public void close() { // UserDataSet. // DB Disconnection. FORCS Co., LTD 155

OZ API Developer's Guide (for Java) ResultSet ResultSet ResultSet. ResultSet. (.) JDBC javasql.resultset Interface 30 UDS. import java.sql.*; import java.math.bigdecimal; import java.util.calendar; import java.util.enumeration; public class ResultSet_User implements ResultSet{ public ResultSet_User( ) { public boolean next() throws SQLException{ //. public String getstring(string columnname) throws SQLException{ //. // getstring // Method. // getboolean(string columnname) // getbyte(string columnname) // getshort(string columnname) // getint(string columnname // getlong(string columnname // getfloat(string columnname) // getdouble(string columnname // getbigdecimal(string columnname) // getdate(string columnname) // gettime(string columnname) // gettimestamp(string columnname) // getblob(string columnname) // getclob(string columnname) // getbinarystream(string columnname) public ResultSetMetaData getmetadata() throws SQLException{ 156 FORCS Co., LTD

// ResultSetMetaData // ResultSetMetaData Method. ResultSetMetaData ResultSetMetaData. import java.sql.sqlexception; import java.sql.types; import java.util.*; public class ResultSetMetaData_User implements ResultSetMetaData{ public ResultSetMetaData_User(String[] meta) { public int getcolumncount() throws SQLException{ //. public String getcolumnname(int column) throws SQLException{ // (column). public int getcolumntype(int column) throws SQLException{ // (column) UDS, UDS. <UdsFile.java> import oz.uds.*; import java.sql.resultset; import java.io.filereader; import java.io.ioexception; import java.util.stringtokenizer; import java.util.vector; FORCS Co., LTD 157

OZ API Developer's Guide (for Java) public class UdsFile implements OZUserDataStore{ private StringBuffer Sbuffer; private Vector mainv; //subv. private Vector subv; private String[][] data; private String[] meta; private static final String rootfilename = ""; private static final String maindiv = "\n"; private static final String subdiv = "\,"; public void init() throws OZUserDataStoreException { mainv = new Vector(); public ResultSet getresultset(string command) throws OZUserDataStoreException { FileReader in = null; Sbuffer = new StringBuffer(); try{ in = new FileReader(rootFileName + command); char[] buffer = new char[256]; int n; while((n = in.read(buffer)) > -1){ Sbuffer.append(new String(buffer, 0, n)); catch(ioexception e){ e.printstacktrace(); throw new OZUserDataStoreException(e.getMessage()); finally { try{ if(in!= null)in.close(); catch(ioexception e){ finally{ in = null; String s = Sbuffer.toString(); ////////////////////////////////////////////////////////////////////////////// StringTokenizer st1 = new StringTokenizer(s,mainDiv); StringTokenizer st2; String tmpstring; /////////////////////meta////////////////////// if(st1.hasmoretokens()){ tmpstring = st1.nexttoken().trim(); st2 = new StringTokenizer(tmpString,subDiv); subv = new Vector(); 158 FORCS Co., LTD

while (st2.hasmoretokens()){ subv.addelement(st2.nexttoken().trim()); meta = new String[subV.size()]; subv.copyinto(meta); //////////////////////////////////////////////// while (st1.hasmoretokens()) { tmpstring = st1.nexttoken().trim(); st2 = new StringTokenizer(tmpString,subDiv); subv = new Vector(); while (st2.hasmoretokens()){ subv.addelement(st2.nexttoken().trim()); mainv.addelement(subv); data = new String[mainV.size()][]; for(int i = 0; i < mainv.size(); i++){ subv = (Vector)mainV.elementAt(i); data[i] = new String[subV.size()]; subv.copyinto(data[i]); Sbuffer = null; mainv.clear(); //////////////////////////////////////////////////////// if(meta == null data == null){ throw new OZUserDataStoreException("Data is Invalide"); return new ResultSet_File(meta, data); public void freeresultset(resultset rst){ Sbuffer = null; data = null; meta = null; mainv.clear(); public void close() { Sbuffer = null; data = null; meta = null; mainv = null; <ResultSet_File.java> import java.sql.*; import java.math.bigdecimal; FORCS Co., LTD 159

OZ API Developer's Guide (for Java) import java.util.calendar; import java.util.enumeration; public class ResultSet_File implements ResultSet{ private String[][] data; private String[] meta; private int index; private int size; public ResultSet_File(String[] meta, String[][] data) { this.meta = meta; this.data = data; size = data.length; index = -1; public boolean next() throws SQLException{ index++; if(index == size) return false; return true; public String getstring(string columnname) throws SQLException{ int i = findindex(columnname); if(i > -1){ try{ return data[index][i]; catch(exception e){ throw new SQLException("Internal Error"); else{ return null; private final int findindex(string columnname){ for(int i = 0; i < meta.length; i++){ if(columnname.equals(meta[i])){ return i; return -1; public String getstring(int columnindex) throws SQLException{ return null; public ResultSetMetaData getmetadata() throws SQLException{ return new ResultSetMetaData_File(meta); ////////////////////////////////////////////////////////////////////////////// 160 FORCS Co., LTD

//. public boolean getboolean(string columnname) throws SQLException{ return false; public byte getbyte(string columnname) throws SQLException{ return -1; public short getshort(string columnname) throws SQLException{ return -1; public int getint(string columnname) throws SQLException{ return -1; public long getlong(string columnname) throws SQLException{ return -1; public float getfloat(string columnname) throws SQLException{ return -1; public double getdouble(string columnname) throws SQLException{ return -1; public BigDecimal getbigdecimal(string columnname) throws SQLException{ return null; public java.sql.date getdate(string columnname) throws SQLException{ return null; public java.sql.time gettime(string columnname) throws SQLException{ return null; public java.sql.timestamp gettimestamp(string columnname) throws SQLException{ return null; public Blob getblob(string columnname) throws SQLException{ return null; public Clob getclob(string columnname) throws SQLException{ return null; public java.io.inputstream getbinarystream(string columnname) throws SQLException{ return null; /////////////////////////////////////////////////////////////////////////////// public boolean getboolean(int columnindex) throws SQLException{return false; FORCS Co., LTD 161

OZ API Developer's Guide (for Java) public byte getbyte(int columnindex) throws SQLException{return -1; public short getshort(int columnindex) throws SQLException{return -1; public int getint(int columnindex) throws SQLException{return -1; public long getlong(int columnindex) throws SQLException{return -1; public float getfloat(int columnindex) throws SQLException{return -1; public double getdouble(int columnindex) throws SQLException{return -1; public BigDecimal getbigdecimal(int columnindex) throws SQLException{return null; public java.sql.date getdate(int columnindex) throws SQLException{return null; public java.sql.time gettime(int columnindex) throws SQLException{return null; public java.sql.timestamp gettimestamp(int columnindex) throws SQLException{return null; public Blob getblob(int columnindex) throws SQLException{return null; public Clob getclob(int columnindex) throws SQLException{return null; public java.io.inputstream getbinarystream(int columnindex) throws SQLException{return null; /////////////////////////////////////////////////////////////////////////////// public void close() throws SQLException{ public boolean wasnull() throws SQLException{return false; public byte[] getbytes(int columnindex) throws SQLException{return null; public java.io.inputstream getasciistream(int columnindex) throws SQLException{ return null; public java.io.inputstream getunicodestream(int columnindex) throws SQLException{return null; public byte[] getbytes(string columnname) throws SQLException{return null; public java.io.inputstream getasciistream(string columnname) throws SQLException{return null; public java.io.inputstream getunicodestream(string columnname) throws SQLException{return null; public SQLWarning getwarnings() throws SQLException{return null; public void clearwarnings() throws SQLException{ public String getcursorname() throws SQLException{return null; public Object getobject(int columnindex) throws SQLException{return null; public Object getobject(string columnname) throws SQLException{return null; public int findcolumn(string columnname) throws SQLException{return -1; public java.io.reader getcharacterstream(int columnindex) throws SQLException{return null; public java.io.reader getcharacterstream(string columnname) throws SQLException{return null; public BigDecimal getbigdecimal(int columnindex, int scale) throws SQLException{return null; public BigDecimal getbigdecimal(string columnname, int scale) throws SQLException{return null; public boolean isbeforefirst() throws SQLException{return false; public boolean isafterlast() throws SQLException{return false; public boolean isfirst() throws SQLException{return false; 162 FORCS Co., LTD

public boolean islast() throws SQLException{return false; public void beforefirst() throws SQLException{ public void afterlast() throws SQLException{ public boolean first() throws SQLException{return false; public boolean last() throws SQLException{return false; public int getrow() throws SQLException{return -1; public boolean absolute( int row ) throws SQLException{return false; public boolean relative( int rows ) throws SQLException{return false; public boolean previous() throws SQLException{return false; public void setfetchdirection(int direction) throws SQLException{ public int getfetchdirection() throws SQLException{return -1; public void setfetchsize(int rows) throws SQLException{ public int getfetchsize() throws SQLException{return -1; public int gettype() throws SQLException{return -1; public int getconcurrency() throws SQLException{return -1; public boolean rowupdated() throws SQLException{return false; public boolean rowinserted() throws SQLException{return false; public boolean rowdeleted() throws SQLException{return false; public Statement getstatement() throws SQLException{return null; public Object getobject(int i, java.util.map map) throws SQLException{return null; public Ref getref(int i) throws SQLException{return null; public Array getarray(int i) throws SQLException{return null; public Object getobject(string colname, java.util.map map) throws SQLException{return null; public Ref getref(string colname) throws SQLException{return null; public Array getarray(string colname) throws SQLException{return null; public java.sql.date getdate(int columnindex, Calendar cal) throws SQLException{return null; public java.sql.date getdate(string columnname, Calendar cal) throws SQLException{return null; public java.sql.time gettime(int columnindex, Calendar cal) throws SQLException{return null; public java.sql.time gettime(string columnname, Calendar cal) throws SQLException{return null; public java.sql.timestamp gettimestamp(int columnindex, Calendar cal) throws SQLException{return null; public java.sql.timestamp gettimestamp(string columnname, Calendar cal) throws SQLException{return null; /////////////////////////////////////////////////////////////////////////////// public void updatenull(int columnindex) throws SQLException{ public void updateboolean(int columnindex, boolean x) throws SQLException{ public void updatebyte(int columnindex, byte x) throws SQLException{ public void updateshort(int columnindex, short x) throws SQLException{ public void updateint(int columnindex, int x) throws SQLException{ public void updatelong(int columnindex, long x) throws SQLException{ public void updatefloat(int columnindex, float x) throws SQLException{ public void updatedouble(int columnindex, double x) throws SQLException{ FORCS Co., LTD 163

OZ API Developer's Guide (for Java) public void updatebigdecimal(int columnindex, BigDecimal x) throws SQLException{ public void updatestring(int columnindex, String x) throws SQLException{ public void updatebytes(int columnindex, byte x[]) throws SQLException{ public void updatedate(int columnindex, java.sql.date x) throws SQLException{ public void updatetime(int columnindex, java.sql.time x) throws SQLException{ public void updatetimestamp(int columnindex, java.sql.timestamp x) throws SQLException{ public void updateasciistream(int columnindex, java.io.inputstream x, int length) throws SQLException{ public void updatebinarystream(int columnindex, java.io.inputstream x, int length) throws SQLException{ public void updatecharacterstream(int columnindex, java.io.reader x, int length) throws SQLException{ public void updateobject(int columnindex, Object x, int scale) throws SQLException{ public void updateobject(int columnindex, Object x) throws SQLException{ public void updatenull(string columnname) throws SQLException{ public void updateboolean(string columnname, boolean x) throws SQLException{ public void updatebyte(string columnname, byte x) throws SQLException{ public void updateshort(string columnname, short x) throws SQLException{ public void updateint(string columnname, int x) throws SQLException{ public void updatelong(string columnname, long x) throws SQLException{ public void updatefloat(string columnname, float x) throws SQLException{ public void updatedouble(string columnname, double x) throws SQLException{ public void updatebigdecimal(string columnname, BigDecimal x) throws SQLException{ public void updatestring(string columnname, String x) throws SQLException{ public void updatebytes(string columnname, byte x[]) throws SQLException{ public void updatedate(string columnname, java.sql.date x) throws SQLException{ public void updatetime(string columnname, java.sql.time x) throws SQLException{ public void updatetimestamp(string columnname, java.sql.timestamp x) throws SQLException{ public void updateasciistream(string columnname, java.io.inputstream x, int length) throws SQLException{ public void updatebinarystream(string columnname, java.io.inputstream x, int length) throws SQLException{ public void updatecharacterstream(string columnname, java.io.reader reader, int length) throws SQLException{ public void updateobject(string columnname, Object x, int scale) throws SQLException{ public void updateobject(string columnname, Object x) throws SQLException{ public void insertrow() throws SQLException{ 164 FORCS Co., LTD

public void updaterow() throws SQLException{ public void deleterow() throws SQLException{ public void refreshrow() throws SQLException{ public void cancelrowupdates() throws SQLException{ public void movetoinsertrow() throws SQLException{ public void movetocurrentrow() throws SQLException{ ////////////////////////////////////////////////////////////////////////////// <ResultMetaData_File.java> import java.sql.resultsetmetadata; import java.sql.sqlexception; import java.sql.types; import java.util.*; public class ResultSetMetaData_File implements ResultSetMetaData{ String[] meta; public ResultSetMetaData_File(String[] meta) { this.meta = meta; public int getcolumncount() throws SQLException{ return meta.length; public String getcolumnname(int column) throws SQLException{ if(0 < column && column < getcolumncount()+1){ return meta[column-1]; else{ throw new SQLException(); public int getcolumntype(int column) throws SQLException{ return Types.VARCHAR; public int isnullable(int column) throws SQLException{return -1; public int getcolumndisplaysize(int column) throws SQLException{return -1; public int getprecision(int column) throws SQLException{return -1; public int getscale(int column) throws SQLException{return -1; public boolean isautoincrement(int column) throws SQLException{ return false; public boolean iscasesensitive(int column) throws SQLException{ return false; public boolean issearchable(int column) throws SQLException{return false; public boolean iscurrency(int column) throws SQLException{return false; public boolean issigned(int column) throws SQLException{return false; public boolean isreadonly(int column) throws SQLException{return false; public boolean iswritable(int column) throws SQLException{return false; public boolean isdefinitelywritable(int column) throws SQLException{ FORCS Co., LTD 165

OZ API Developer's Guide (for Java) return false; public String getcolumnlabel(int column) throws SQLException{return null; public String getschemaname(int column) throws SQLException{return null; public String gettablename(int column) throws SQLException{return null; public String getcatalogname(int column) throws SQLException{return null; public String getcolumntypename(int column) throws SQLException{ return null; public String getcolumnclassname(int column) throws SQLException{ return null; 166 FORCS Co., LTD

User Security Logic USL USL USL FORCS Co., LTD 167

OZ API Developer's Guide (for Java) USL(User Security Logic). USL USL Server USL Client, I/O. USL Flow OZ Server Server Side Network I/O Module USL Server Module Request Response USL Client Module Client Side Network I/O Module OZ Viewer 168 FORCS Co., LTD

USL Web WAS Session Cookie ( ), Network I/O Stream, PKI. Session ( Session USL ) UseUserSecurityLogicVer30=true OZ Server Server Side Network I/O Module WAS 3. 4-1 USL Server Module 4-2 USL 2. USL USL Client Module 4-3 Exception 1. Connection Request Client Side Network I/O Module OZ Viewer <param name= "repository_agent.try_usl_check" value="true"> <param name= "repository_agent.usl_param.args1" value="param1=value1"> FORCS Co., LTD 169

OZ API Developer's Guide (for Java) USL. - USL : OZ_HOME/lib/ozsfw35.jar - USL : OZ_HOME/conf/uslmngr.properties - ozsfw35.jar CLASSPATH. - uslmngr.properties USL,. # # use user security logic apply # UseUserSecurityLogicVer30=true # # default USL(Server&Client) class name (with package name) # OZDefault_SERVER=oz.usl.USL OZDefault_CLIENT=oz.usl.USL uslmngr.properties UseUserSecurityLogicVer30=true, USL. USL. OZDefault_SERVER=oz.usl.USL OZDefault_CLIENT=oz.usl.USL ex) OZDefault_SERVER=oz.usl.OZUSLServerSession OZDefault_CLIENT=oz.usl.OZUSLClientSession 170 FORCS Co., LTD

OZ Report Viewer USL (OZR) USL "repository_agent.try_usl_check" "true". <param name="repository_agent.try_usl_check" value="true"> : "UseUserSecurityLogicVer30" "true" "repository_agent.try_usl_check" "true". USL USL "repository_agent.usl_param.pcount" USL, "repository_agent.usl_param_args#". : "UseUserSecurityLogicVer30" "true", "repository_agent.try_usl_check" "true" USL USL. HTML <html> <body> <object id="ozreportviewer" width="100%" height="100%" classid="clsid:64da633f-e73b- 4344-83BF-48483346CD53"> <param name="connection.servlet" value="http://127.0.0.1:8087/ozservlet/server"> <param name="viewer.configmode" value="html"> <param name="repository_agent.try_usl_check" value="true"> <param name="repository_agent.usl_param_pcount" value="2"> <param name="repository_agent.usl_param.args1" value="param1=value1"> <param name="repository_agent.usl_param.args2" value="param2=value2"> <param name="connection.reportname" value="sample.ozr"> </object> </body> </html> FORCS Co., LTD 171

OZ API Developer's Guide (for Java) OZ Application Viewer USL (OZA) USL "repository_agent.try_usl_check" "true". : "UseUserSecurityLogicVer30" "true" "repository_agent.try_usl_check" "true". USL USL "repository_agent.usl_param.pcount" USL, "repository_agent.usl_param.args#". HTML <html> <body> <object id="ozapplicationviewer" width="100%" height="100%" classid="clsid:907a00f3-7390-4ef2-931b-360546587804"> <param name="repository_agent.type" value="from_ozserver"> <param name="repository_agent.ozserver.servlet" value="http://127.0.0.1:8087/ozservlet/server"> <param name="repository_agent.try_usl_check" value="true"> <param name="repository_agent.usl_param.pcount" value="2"> <param name="repository_agent.usl_param.args1" value="param1=value1"> <param name="repository_agent.usl_param.args2" value="param2=value2"> <param name="ozadoc.path" value="sample.oza"> </object> </body> </html> 172 FORCS Co., LTD

USL USL USL Request Stream Response Stream.. USL oz.cp.ozuslserver createsecureoutputstream(), createsecureinputstream(). Request Stream createsecureinputstream(). Response Stream createsecureoutputstream(). InputStream ( ) InputStream. java.io.inputstream read(). USL DataInputStream read() DataInputStream. read. OutputStream ( ) OutputStream. java.io.outputstream write(), flush(). USL DataOutputStream write DataOutputStream. write() flush FORCS Co., LTD 173

OZ API Developer's Guide (for Java) DataOutputStream. flush. USL USL Request Stream USL Response Stream.. USL OZ USL DLL USL. createsecureoutputstream(), createsecureinputstream(). Request Stream createsecureoutputstream(). Response Stream createsecureinputstream(). USL createsecureoutputstream() OutputStream writeutf() writeint(). InputStream ( ) CJDataInputStream.. USL CJDataInputStream read() CJDataInputStream. read. OutputStream ( ) CJDataOutputStream. CJDataOutputStream 174 FORCS Co., LTD

. USL CJDataOutputStream CJDataOutputStream. write flush CJDataOutputStream. flush. USL 1 - USL WAS Valid. OZUSLServerSession.jar, OZUSLClientSession.dll. USL OZ_HOME/conf/uslmngr.properties. # # use user security logic apply # UseUserSecurityLogicVer30=true # # default USL(Server&Client) class name (with package name) # OZDefault_SERVER=oz.usl.OZUSLServerSession OZDefault_CLIENT=oz.usl.OZUSLClientSession USL OZUSLServerSession OZUSLServer. OZUSLServerSession, WAS OZ Servlet.. <<OZUSLServerSession.java>> FORCS Co., LTD 175

OZ API Developer's Guide (for Java) package oz.usl; import java.io.*; import java.util.enumeration; import javax.servlet.http.httpsession; import oz.datafactory.util.ozattributelist; import oz.cp.message.ozcmexception; import oz.framework.cp.io.ozdatainputstream; import oz.framework.cp.io.ozdataoutputstream; import org.apache.log4j.*; public class OZUSLServerSession extends OZUSLServer { //////////////////////////////////////////////////////////////////// // Non-custom section. Leave below as is. static protected Category cat = Category.getInstance("oz35.server"); public OZUSLServerSession(){ super(); /////////////////////////////////////////////////////////////////// // custom section. add your codes & modify // invoked after set httpsession & clientip public void initialize(){ // invoked once per a transaction when prepare to read from client public InputStream createsecureinputstream(datainputstream raw_in) throws OzcmException { cat.debug("ozuslserversession::createsecureinputstream"); try{ params_from_client.read(new OZDataInputStream(raw_in)); for(int i=params_from_client.getlength()-1; i>=0; i--){ cat.debug("ozuslserversession::createsecureinputstream: " + params_from_client.getkey(i) + ", " + params_from_client.getvalue(i)); catch(exception e){ cat.error("ozuslserversession: read params from client:", e); throw new OzcmException(e.getMessage()); return null; 176 FORCS Co., LTD

// invoked once per a transaction when prepare to write to client public OutputStream createsecureoutputstream(dataoutputstream raw_out) throws OzcmException { cat.debug("ozuslserversession::createsecureoutputstream"); try{ if(this.http_request!= null){ HttpSession http_session = http_request.getsession(false); if(http_session == null){ http_session = http_request.getsession(true); http_session.setattribute("user_id", params_from_client.get("user_id")); http_session.setattribute("user_pw", params_from_client.get("user_pw")); for(int i = params_from_client.getlength()-1; i>=0; i--){ http_session.setattribute(params_from_client.getname(i), params_from_client.getvalue(i)); Enumeration e = http_session.getattributenames(); for (; e.hasmoreelements(); ) { String key = (String) e.nextelement(); String value = (String)http_session.getAttribute(key); params_to_client.put(key, value); cat.debug("ozuslserversession::http_session: "+key+", "+value); params_to_client.write(new OZDataOutputStream(raw_out)); catch(exception e){ cat.error("ozuslserversession: write params to client:", e); throw new OzcmException(e.getMessage()); return null; Servlet WAS /oz (Servlet). WEB- FORCS Co., LTD 177

OZ API Developer's Guide (for Java) INF WEB-INF\sessions., http://localhost:8100/setcookie.jsp /http://localhost:8100/test/getcookie.jsp WAS /oz, http://localhost:8100/oz/getcookie.jsp. OZ. WAS. Process /oz. Cookie. USL OZUSLClientSession OZUSLClient. createsecureinputstream InputStream. <<OZUSLClientSession.cpp>> #include <stdafx.h> #include <oz/usl/ozuslclient.h> #include <oz/usl/ozuslclientsession.h> #include <common/io/pc1encode128outputstream.h> #include <common/io/pc1decode128inputstream.h> #include <common/io/ozfuncinputstream.h> #include <common/io/ozfuncoutputstream.h> #include <oz/usl/ozuslclientwrapper.h> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif OZUSLClientSession::OZUSLClientSession() : OZUSLClient() { 178 FORCS Co., LTD

OZUSLClientSession::~OZUSLClientSession() { CJInputStream* OZUSLClientSession::createSecureInputStream(CJDataInputStream* raw_in, CJOZAttributeList& params_from_server_to_fillup, bool binit) { super::createsecureinputstream(raw_in, params_from_server_to_fillup, binit); return NULL; CJOutputStream * OZUSLClientSession::createSecureOutputStream (CJDataOutputStream* raw_out, CJOZAttributeList& params_from_client_to_send) { super::createsecureoutputstream(raw_out, params_from_client_to_send); return NULL; void OZUSLClientSession::destory() { delete this; /* * OZUSLClient_create: initialize User Secure Logic * * this function is called every time a trasaction with OZServer occured * * @param [in] tags null terminated UTF8 OZParameter tag string array to send to server * @param [in] values null terminated UTF8 OZParameter value string array to send to server * @param [in] env_raw environment variable used in OZClient. just forget about what is it. * however you must care about to pass env_raw to rawread(write)byte(barray) * functions. * * @param [in] rawreadbyte function to get the encryptied raw byte from server side USL to decrypt * @param [in] rawreadbarray function to get the encryptied raw byte array from server side USL to decrypt * @param [in] rawavailable function to get the tempory readable input buffer size * @param [in] rawreadclose function to close raw inputstream * * @param [in] rawwritebyte function to get the encryptied raw byte to send to server side USL * @param [in] rawwritebarray function to get the encryptied raw byte array to FORCS Co., LTD 179

OZ API Developer's Guide (for Java) send to server side USL * @param [in] rawflush function to flush raw outputstream * @param [in] rawwriteclose function to close raw outputstream * * @param [in] rawgetlasterrormessage function to get error message from raw in/out stream * * @param [out] do_read_hook whether do input stream wrappering with OZUSLClient_read or not * @param [out] do_write_hook whether do output stream wrappering with OZUSLClient_write or not * @param [out] env the state variable if needs. * state variable is passed to all USL functions * to cover stateless function call interface. * * @return returns >= 0 if success returns returns < 0 if error. * if got error return, OZClient will call OZUSLClient_getLastErrorMessage * to get detailed error message. */ extern "C" declspec(dllexport) int OZUSLClient_create ( byte* params_bytes, int params_bytes_len, void* env_raw, int ( cdecl *rawreadbyte)(void* env_raw, byte* p_value, int *read_len), int ( cdecl *rawreadbarray)(void* env_raw, byte* array_value, int len, int *read_len), int ( cdecl *rawavailable)(void* env_raw, int *available_len), int ( cdecl *rawreadclose)(void* env_raw, BOOL do_not_close_raw_in), int ( cdecl *rawwritebyte)(void* env_raw, byte value), int ( cdecl *rawwritebarray)(void* env_raw, byte* array_value, int len), int ( cdecl *rawflush)(void* env_raw), int ( cdecl *rawwriteclose)(void* env_raw), byte* ( cdecl *rawgetlasterrormessage)(void* env_raw), void** env ) { TRACE(_T("OZUSLClient_create\n")); OZUSLClientWrapper *uslw = NULL; uslw = new OZUSLClientWrapper(); uslw->raw_in = new CJDataInputStream(new OZFuncInputStream(env_raw, uslw, rawreadbyte, rawreadbarray, rawavailable, rawreadclose, rawgetlasterrormessage), TRUE); uslw->raw_out = new CJDataOutputStream(new OZFuncOutputStream(env_raw, rawwritebyte, rawwritebarray, rawflush, rawwriteclose, rawgetlasterrormessage), TRUE); 180 FORCS Co., LTD

uslw->ozusl = new OZUSLClientSession(); CJOZAttributeList attrs; CJByteArrayInputStream bin((char*)params_bytes, params_bytes_len, FALSE); CJDataInputStream din(&bin, FALSE); attrs.read(din); uslw->ozusl->setserverip(attrs.get(_t("oz_server_ip"))); uslw->ozusl->setserverurl(attrs.get(_t("oz_server_url"))); *env = uslw; return OZUSLCLIENT_INTERFACE_VERSION; // all ok. USL (getuslserverparam) USL. USL. []-[ ] ( ). []-[]-[]-[ ] ( ). []-[]-[]-[] ( ). [ ]. string str; str = getuslserverparam( OZUSL_SERVER_URL ); // name USL OZUSL_SERVER_URL setattr( caption,str); write( str ); // ( CTRL+Z) [] [] ( ) 'getuslserverparam.ozr'. 'D:\Repository'. html. FORCS Co., LTD 181

OZ API Developer's Guide (for Java) <HTML> <BODY> <OBJECT id = "ozviewer" CLASSID="CLSID:0DEF32F8-170F-46f8-B1FF- 4BF7443F5F25" width="100%" height="100%"> <param name="connection.servlet" value="http://127.0.0.1:8080/oz35/server"> <param name="connection.reportname" value="/getuslserverparam.ozr"> <param name="viewer.isframe" value="true"> <param name="information.debug" value="true"> </OBJECT> </body> </HTML> caption USL. 182 FORCS Co., LTD

USL 2 - PKI USL PKI. USL PKI.. Output Stream write(), flush(), flush().., PKI. package ozusl; import java.io.*; import oz.cp.ozuslserver; import javax.servlet.http.httpsession; import java.security.*; import java.security.spec.*; import oz.cp.message.ozcmexception; import pki.lib.*; // PKI import public class PKIUSLServer extends OZUSLServer { protected String share_key_tag = null; protected String share_key_value = null; protected Secure _secu = null; protected EnvelopedMessage _se = null; public PKIUSLServer() { class PKIUSLServerOutputStream extends OutputStream { ByteArrayOutputStream bout; DataOutputStream out_org = null; int b_length = 0; FORCS Co., LTD 183

OZ API Developer's Guide (for Java) public PKIUSLServerOutputStream(HttpSession _http_session, String _report_name, DataOutputStream _out_org) throws OzcmException { ////////////////////// Session ////////////////////// share_key_value = (String)_http_session.getValue(share_key_tag); if (share_key_value==null) throw new OzcmException("session was not found"); /////////////////////////////////////////// bout = new ByteArrayOutputStream(); out_org = _out_org; public void write(int b) throws IOException { bout.write(b); b_length++; public void close() throws IOException { public void flush() throws IOException { try{ ///////////////////// ////////////////////// _secu = Secure.getInstance(); _se = new EnvelopedMessage( _secu); String dummy=_se.encryptinit(secu.web, secu.km, share_key_value); bout.flush(); byte[] b_org = bout.tobytearray(); byte[] encrypt_base64 = _se.encryptupdate(b_org).getbytes(); /////////////////////////////////////// out_org.writeint(encrypt_base64.length); out_org.write(encrypt_base64, 0, encrypt_base64.length); out_org.flush(); catch(exception e){ e.printstacktrace(); throw new IOException("PKI: error... " + e.tostring()); public InputStream createsecureinputstream(datainputstream org_in) throws OzcmException { try{ 184 FORCS Co., LTD

share_key_tag = org_in.readutf(); if(share_key_tag.equals("param is null") share_key_tag.equals("") share_key_tag==null) share_key_tag="session_id"; catch(exception e){ share_key_tag = null; e.printstacktrace(); throw new OzcmException( "PKI: can't get share_key! check USL configuration for " + report_name); return null; public OutputStream createsecureoutputstream(dataoutputstream out_org) throws OzcmException { return new AAUSLServerOutputStream(http_session, report_name, out_org); USL USL PKI COM. CJDataInputStream.. <<USLClient.cpp>> // USLClient.cpp: implementation of the CUSLClient class. // ////////////////////////////////////////////////////////////////////// #include <stdafx.h> #include <ozuslclient/ozuslclient.h> #include <ozuslclient/uslclient.h> #include <ozuslclient/axmofe.h> #include <ozuslclient/jusldatainputstream.h> #include <ozuslclient/jusldataoutputstream.h> #ifdef _DEBUG #undef THIS_FILE static char THIS_FILE[]= FILE ; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction FORCS Co., LTD 185

OZ API Developer's Guide (for Java) ////////////////////////////////////////////////////////////////////// CUSLClient::CUSLClient() { m_str_ip = _T(""); m_str_url = _T(""); m_str_pub_key_path = _T(""); m_parameters = NULL; CUSLClient::~CUSLClient() { void CUSLClient::SetServerIP(CString str_ip) { m_str_ip = str_ip; void CUSLClient::SetServerURL(CString str_url) { m_str_url = str_url; void CUSLClient::SetParameter(Parameter * parameters) { m_parameters = parameters; CJDataInputStream * CUSLClient::GetSecuredInputStream(CJDataInputStream *pin) { return new CJUSLDataInputStream(pIn,TRUE, m_str_pub_key_path); CJDataOutputStream * CUSLClient::GetSecuredOutputStream( CJDataOutputStream *pout) { CJUSLDataOutputStream out(pout,false, m_parameters); out.writesessionkeytoserver(); m_str_pub_key_path = out.getpublickeypath(); return pout; <<JUSLDataInputStream.cpp>> // JUSLDataInputStream.cpp: implementation of the CJUSLDataInputStream class. // ////////////////////////////////////////////////////////////////////// #include "stdafx.h" 186 FORCS Co., LTD

#include "JUSLDataInputStream.h" #include <ozuslclient/axmofe.h> #include <ozuslclient/base64.h> #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif _DEBUG ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CJUSLDataInputStream::CJUSLDataInputStream(CJDataInputStream *pin, BOOL _isshoulddelete, CString str_pub_key) : CJDataInputStream(pIn, _isshoulddelete) { try{ Jint jsize = pin->readint(); //byte* b_org = new byte[size]; CJArray<Jbyte>* arraybuffer; char * buf = new char[2048]; int readsize = -1; CJByteArrayOutputStream bout; try{ while(true) { readsize = pin->read(buf,0,2048); if (readsize ==0) break; bout.write(buf,0,readsize); arraybuffer = bout.tobytearrayforsign(); in->close(); delete buf; catch(czexception *eof){ throw eof; IAxMOFE_NCA pki; if(!pki.createdispatch(_t("axmofe.axmofe_nca.1"), NULL)) { char * tmp = arraybuffer->getbuffer(); int ssize = arraybuffer->length(); CString decrypt_base64 = pki.symmdecryptdataex(tmp, pki.readdatafile(str_pub_key), _T("SEED")); FORCS Co., LTD 187

OZ API Developer's Guide (for Java) byte* tmpbyte2 = new byte[decrypt_base64.getlength()]; int dsie = decrypt_base64.getlength(); int size = 0; CTP_Base64Decode((unsigned char*) decrypt_base64.getbuffer(decrypt_base64.getlength()), tmpbyte2, &size); m_pin = new CJDataInputStream(new CJByteArrayInputStream((char*)tmpByte2,0,size, TRUE), TRUE); in = m_pin; delete arraybuffer; catch(czexception * ex){ throw ex; CJUSLDataInputStream::~CJUSLDataInputStream() { /* if(m_pin) { m_pin->close(); delete m_pin; */ void CJUSLDataInputStream::GetBytes (const CString str, byte* b, int len) { for (int i = 0 ; i < len ; i++) { b[i] =str.getat (i); Jint CJUSLDataInputStream::available() { return m_pin->available(); Jbyte CJUSLDataInputStream::readByte()//throw (CJIOException *) { return m_pin->readbyte(); 188 FORCS Co., LTD

Jlong CJUSLDataInputStream::readLong()//throw (CJIOException *) { return m_pin->readlong(); Jdouble CJUSLDataInputStream::readDouble()//throw (CJIOException *) { return m_pin->readdouble(); Jfloat CJUSLDataInputStream::readFloat()//throw (CJIOException *) { return m_pin->readfloat(); Jboolean CJUSLDataInputStream::readBoolean()//throw (CJIOException *) { return m_pin->readboolean(); Jshort CJUSLDataInputStream::readShort()//throw (CJIOException *) { return m_pin->readshort(); Jchar CJUSLDataInputStream::readChar()//throw (CJIOException *) { return m_pin->readchar(); Jint CJUSLDataInputStream::readInt()//throw (CJIOException *) { return m_pin->readint(); CString CJUSLDataInputStream::readUTF()//throw (CJIOException *) { return m_pin->readutf(); CString CJUSLDataInputStream::readString()//throw (CJIOException *) { return m_pin->readstring(); Jint CJUSLDataInputStream::read(CJArray<Jbyte> &b)//throw (CJIOException *) { return m_pin->read(b); FORCS Co., LTD 189

OZ API Developer's Guide (for Java) Jint CJUSLDataInputStream::read(CJArray<Jbyte> &b, Jint off, Jint len) //throw (CJIOException *) { return m_pin->read(b, off, len); int CJUSLDataInputStream::getRemainSize() { return m_pin->getremainsize(); Jbyte * CJUSLDataInputStream::getBufferPointer() { return m_pin->getbufferpointer(); <<JUSLDataOutputStream.cpp>> // JUSLDataOutputStream.cpp: implementation of the CJUSLDataOutputStream class. ////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "JUSLDataOutputStream.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; #endif _DEBUG ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CJUSLDataOutputStream::CJUSLDataOutputStream(CJDataOutputStream *pout, BOOL _isshoulddelete, Parameter *parameter) : CJDataOutputStream(pOut, _isshoulddelete) { m_pout = pout; m_parameter = parameter; m_str_pub_key_path = _T(""); CJUSLDataOutputStream::~CJUSLDataOutputStream() { void CJUSLDataOutputStream::WriteSessionKeyToServer() 190 FORCS Co., LTD

{ try{ BOOL b = TRUE; for (int i=0; i<m_parameter->getsize(); i++) { // Read session key from viewer's parameter to wriete this information to // if(m_parameter->elementat(i).name.comparenocase(_t("session_name")) == 0){ m_pout->writeutf(m_parameter->elementat(i).value); b=false; //Read ksign's key path to decode the ecoded data from if (m_parameter->elementat(i).name.comparenocase(_t("ksign_path")) == 0) { m_str_pub_key_path = m_parameter->elementat(i).value; catch(czexception * e){ throw e; CString CJUSLDataOutputStream::GetPublicKeyPath() { return m_str_pub_key_path; PKI PKI ActiveX. PKI ActiveX byte[]. String PKI String. byte[] byte[]. String base64.. Client PKI ActiveX PC ActiveX. VJ++ COM Wrapper PKI. FORCS Co., LTD 191

OZ API Developer's Guide (for Java) PKI Import USL. 192 FORCS Co., LTD

C FORCS Co., LTD 193

OZ API Developer's Guide (for Java) /..,. "PDF417". DLL : ozc_.dll " PDF 417" "ozc_pdf417.dll". launch.cfg classpath. 194 FORCS Co., LTD

(,, ) ozc_pdf417.dll WIN32 API LoadLibrary. DLL ozuser.zip dll zip (: ozrviewer.idf ) ZTransfer (*.idf). ". ". : PDF SVG. Excel, Word, Powerpoint, HTML. FORCS Co., LTD 195

OZ API Developer's Guide (for Java) interface oz.ucomp.ozusercomp - :. - Method public void setmeta(ozusercompmeta meta) OZUserCompMete. public void paint(oz.client.igraphics g, oz.client.ozpoint basepoint, oz.client.shape.ilabel label, String data). Data Caption.. : Tiff paintex. public oz.client.ozdimension getautosize(oz.client.shape.ilabel label, String data) ''.,. interface oz.ucomp.ozusercompmeta - :. - Method public void xmlbind(java.util.hashtable t). public void setattr(string s, String v). (s :, v : ) public void writeme(oz.framework.cp.io.ozdataoutputstream out) (Serialize) out.,. 196 FORCS Co., LTD

public void readme(oz.framework.cp.io.ozdatainputstream in) in (Serialize).,. interface oz.ucomp.ozusercompmetabeaninfo - :. - Method public PropertyDescriptor[] getpropertys() PropertyDescriptor. Class oz.client.ozpoint, oz.client.ozdimension java.awt.point java.awt.dimension float oz.framework.cp.io.ozdataoutputstream, oz.framework.cp.io.ozdatainputstream java.io.dataoutputstream java.io.ozdatainputstream oz.client.shape.ilabel oz.client.igraphics java.awt.graphics Wrapping PDF417 2D.. FORCS Co., LTD 197

OZ API Developer's Guide (for Java) PDF417.java package ucomp; import oz.ucomp.*; public class PDF417 implements OZUserComp{ protected PDF417Meta meta = null; public void setmeta(ozusercompmeta meta){ // PDF417Meta settting this.meta = (PDF417Meta)meta; public void paint(oz.client.igraphics g, oz.client.ozpoint basepoint, oz.client.shape.ilabel label, String data)throws OZUserCompException{ // fill black rectangle g.setozcolor(oz.client.ozcolor.black); g.fillrect(basepoint.x, basepoint.y, label.getwidth(), label.getheight()); public oz.client.ozdimension getautosize(oz.client.shape.ilabel label, String data) throws OZUserCompException{ // no effect return new oz.client.ozdimension(label.getwidth(), label.getheight()); PDF417Meta.java package ucomp; import oz.ucomp.*; public class PDF417Meta extends OZUserCompMeta{ //propertynames is text for designer property name public final static String[] propertynames = new String[]{"","","","X","Y", "dll ", "dll URL", "dll"; public PDF417Meta() { public void setattr(string s, String v)throws OZUserCompException{ //attribute setting function // s is attribute name // v is attribute value string if(s.equalsignorecase("pdf417_rownum")){ setrownum( Integer.parseInt(v) ); else if(s.equalsignorecase("pdf417_colnum")){ setcolnum( Integer.parseInt(v) ); else if(s.equalsignorecase("pdf417_ecc")){ setecc( Integer.parseInt(v) ); else if(s.equalsignorecase("pdf417_xscale")){ setxscale( Integer.parseInt(v) ); 198 FORCS Co., LTD

else if(s.equalsignorecase("pdf417_yscale")){ setyscale( Integer.parseInt(v) ); else if(s.equalsignorecase("pdf417_dllname")){ setdllname( v ); else if(s.equalsignorecase("pdf417_dllurl")){ setdllurl( v ); else if(s.equalsignorecase("pdf417_dllsize")){ setdllsize( Integer.parseInt(v) ); public void xmlbind(java.util.hashtable t)throws OZUserCompException{ // attribute save function // Hashtable key is attribute name // Hashtable value is attribute value string t.put("pdf417_rownum", String.valueOf(getRowNum())); t.put("pdf417_colnum", String.valueOf(getColNum())); t.put("pdf417_ecc", String.valueOf(getECC())); t.put("pdf417_xscale", String.valueOf(getXScale())); t.put("pdf417_yscale", String.valueOf(getYScale())); t.put("pdf417_dllname", getdllname()); t.put("pdf417_dllurl", getdllurl()); t.put("pdf417_dllsize", String.valueOf(getDllSize())); public void writeme(oz.framework.cp.io.ozdataoutputstream out) throws Exception{ //serialize write function out.writeint(rownum); out.writeint(colnum); out.writeint(ecc); out.writeint(xscale); out.writeint(yscale); out.writeint(dllsize); out.writeutf2(dllname); out.writeutf2(dllurl); public void readme(oz.framework.cp.io.ozdatainputstream in)throws Exception{ //serialize read function rownum = in.readint(); colnum = in.readint(); ecc = in.readint(); xscale = in.readint(); yscale = in.readint(); dllsize = in.readint(); dllname = in.readutf2(); dllurl = in.readutf2(); int rownum = 0; int colnum = 8; FORCS Co., LTD 199

OZ API Developer's Guide (for Java) int ecc = 0; int xscale = 1; int yscale = 1; String dllname = ""; String dllurl = ""; int dllsize = 67000; public int getrownum(){ return rownum; public int getcolnum(){ return colnum; public int getecc(){ return ecc; public int getxscale(){ return xscale; public int getyscale(){ return yscale; public String getdllname(){ return dllname; public String getdllurl(){ return dllurl; public int getdllsize(){ return dllsize; //firepropertychanglistener is fuction for attribute change event public void setrownum(int i){ if(i < 0)return; int oldvalue = getrownum(); rownum = i; firepropertychanglistener(propertynames[0], new Integer(oldValue), new Integer(i)); public void setcolnum(int i){ if(i < 0)return; int oldvalue = getcolnum(); colnum = i; firepropertychanglistener(propertynames[1], new Integer(oldValue), new Integer(i)); public void setecc(int i){ if(i < 0)return; int oldvalue = getecc(); 200 FORCS Co., LTD

ecc = i; firepropertychanglistener(propertynames[2], new Integer(oldValue), new Integer(i)); public void setxscale(int i){ if(i < 1)return; int oldvalue = getxscale(); xscale = i; firepropertychanglistener(propertynames[3], new Integer(oldValue), new Integer(i)); public void setyscale(int i){ if(i < 1)return; int oldvalue = getyscale(); yscale = i; firepropertychanglistener(propertynames[4], new Integer(oldValue), new Integer(i)); public void setdllname(string i){ String oldvalue = getdllname(); dllname = i; firepropertychanglistener(propertynames[5], oldvalue, i); public void setdllurl(string i){ String oldvalue = getdllurl(); dllurl = i; firepropertychanglistener(propertynames[6], oldvalue, i); public void setdllsize(int i){ if(i < 1)return; int oldvalue = getdllsize(); dllsize = i; firepropertychanglistener(propertynames[7], new Integer(oldValue), new Integer(i)); PDF417MetaBeanInfo.java package ucomp; import java.beans.*; import oz.ucomp.ozusercompmetabeaninfo; public class PDF417MetaBeanInfo extends OZUserCompMetaBeanInfo{ private static Class beanclass = PDF417Meta.class; private static PropertyDescriptor[] rv = null; FORCS Co., LTD 201

OZ API Developer's Guide (for Java) private static String error = null; public PropertyDescriptor[] getpropertys() { if(rv == null) throw new Error(beanClass.getName() + " : " + error); return rv; static{ try { //////////////////////////////////////////////////////////////////////// //PDF417Meta.propertyNames[0] : Attribute Text //"getrownum": Attribute get fuction in PDF417Meta //"setrownum": Attribute set fuction in PDF417Meta //setshortdescription have to start "cb" //////////////////////////////////////////////////////////////////////// PropertyDescriptor rownum = new PropertyDescriptor (PDF417Meta.propertyNames[0], beanclass, "getrownum", "setrownum"); rownum.setshortdescription("cba"); rownum.setconstrained(true); PropertyDescriptor colnum = new PropertyDescriptor (PDF417Meta.propertyNames[1], beanclass, "getcolnum", "setcolnum"); colnum.setshortdescription("cbb"); colnum.setconstrained(true); PropertyDescriptor ecc = new PropertyDescriptor (PDF417Meta.propertyNames[2], beanclass, "getecc", "setecc"); ecc.setshortdescription("cbc"); ecc.setconstrained(true); PropertyDescriptor xscale = new PropertyDescriptor (PDF417Meta.propertyNames[3], beanclass, "getxscale", "setxscale"); xscale.setshortdescription("cbd"); xscale.setconstrained(true); PropertyDescriptor yscale = new PropertyDescriptor (PDF417Meta.propertyNames[4], beanclass, "getyscale", "setyscale"); yscale.setshortdescription("cbe"); yscale.setconstrained(true); PropertyDescriptor dllname = new PropertyDescriptor (PDF417Meta.propertyNames[5], beanclass, "getdllname", "setdllname"); dllname.setshortdescription("cbf"); dllname.setconstrained(true); PropertyDescriptor dllurl = new PropertyDescriptor (PDF417Meta.propertyNames[6], beanclass, "getdllurl", "setdllurl"); 202 FORCS Co., LTD

dllurl.setshortdescription("cbg"); dllurl.setconstrained(true); PropertyDescriptor dllsize = new PropertyDescriptor (PDF417Meta.propertyNames[7], beanclass, "getdllsize", "setdllsize"); dllsize.setshortdescription("cbh"); dllsize.setconstrained(true); rv = new PropertyDescriptor[]{ rownum, colnum, ecc, xscale, yscale, dllname, dllurl, dllsize; catch(introspectionexception e){ rv = null; error = e.tostring(); FORCS Co., LTD 203

OZ API Developer's Guide (for Java).,, - GetNewInstance Argument Return DWORD GetNewInstance()., 0(NULL) - GetCopyInstance DWORD GetCopyInstance(DWORD src). Argument src Return, 0(NULL) - DeleteInstance void DeleteInstance(DWORD src). Argument src Return Serialize - getattrlistlength int getattrlistlength(dword src). Argument src 204 FORCS Co., LTD

Return, -1 - getattrlist BOOL getattrlist(dword src, char** attrs, const int length) attrs. src Argument attrs length Pointer getattrlistlength Return true, false - getattrlength int getattrlength(dword src, const char* name). Argument src name Return, ( ) -1 - getattr BOOL getattr(dword src, const char* name, char* value, const int value_length) name value. Argument src name value value_length getattrlength Return true, ( ) false - setattr BOOL setattr(dword src, const char* name, const char* value). Argument src FORCS Co., LTD 205

OZ API Developer's Guide (for Java) name value Return, ( ) -1 - writeme Argument Return char* writeme(dword src, int * length) serialize. src serialize binary data int length pointer serialize binary data pointer, NULL - readme void readme(dword src, const char* pdata, const int length) serialize binary data. Argument Return src pdata length binary data - paint void paint(dword src, HDC hdc, LPCTSTR data, const float x, const float y, const float w, const float h, const float scale). Argument src hdc data x y w h (WIN32 API ) Caption x y 206 FORCS Co., LTD

scale Return - paintex void paintex( cdecl *paintex)(dword src, HDC hdc, LPCTSTR data, const float x, const float y, const float w, const float h, const float scale const float x_offset, const float y_offset) offset. Argument Return src hdc data x y w h scale x_offset y_offset (WIN32 API ) Caption x y x offset y offset - print void print(dword src, HDC hdc, LPCTSTR data, const float x, const float y, const float w, const float h, const float scale, const float x_offset, const float y_offset). Argument src hdc data x y w h (WIN32 API ) Caption x y FORCS Co., LTD 207

OZ API Developer's Guide (for Java) scale x_offset y_offset x Offset x Offset Return - getautosize void getautosize(dword src, HDC hdc, LPCTSTR data, float * w, float * h),. Argument src hdc data w h (WIN32 API ) Caption pointer pointer Return w, h, C++ dll PDF 417. PDF417.h // hanja.h : main header file for the HANJA DLL // #if!defined(afx_cpdf417app_h 7FDF11DA_5BF8_4C07_9BCF_BB1C08A763FA INCLUDED_) #define AFX_CPdf417App_H 7FDF11DA_5BF8_4C07_9BCF_BB1C08A763FA INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef AFXWIN_H #endif #error include 'stdafx.h' before including this file for PCH 208 FORCS Co., LTD

#include <resource.h> // main symbols // CPdf417App // See CPdf417App.cpp for the implementation of this class // class CPdf417App : public CWinApp { public: CPdf417App(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CPdf417AppaApp) //AFX_VIRTUAL //{{AFX_MSG(CPdf417App) // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code! //AFX_MSG DECLARE_MESSAGE_MAP() ; //{{AFX_INSERT_LOCATION // Microsoft Visual C++ will insert additional declarations immediately //before the previous line. #endif //!defined(afx_cpdf417app_h 7FDF11DA_5BF8_4C07_9BCF_BB1C08A763FA INCLUDED_) PDF417.cpp // OZPdf417Comp.cpp : Defines the initialization routines for the DLL. // #include <stdafx.h> #include <pdf417.h> //////////////////// //PDF417 Barcode api include #include "pdfapi.h" //////////////////// #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = FILE ; FORCS Co., LTD 209

OZ API Developer's Guide (for Java) #endif /////////////////////////////////////////////////////////////////////////////// //////// //PDF417 Barcode api implement static PDFObject g_macroobjin, g_macroobjout; PDFSIZET Encode(LPCTSTR datastr, unsigned short rownum, unsigned short colnum, unsigned short ecc, UINT xscale, UINT yscale) { PDFSIZET ninputlen = 0; char szaspect[ 15 ]; UINT ndpi = 300; PDFSetDefaults(); PDFBinaryMode( false ); PDFSetSymbolStyle( STYLE_NORMAL ); PDFSetECCLevel( ecc ); if(rownum == 0 && colnum == 0){ PDFSetAspect( "1:2" ); else{ PDFSetDimType( USE_FIXED ); PDFSetRowCol( rownum, colnum ); sprintf( szaspect, "%d:%d", xscale+yscale-1, xscale ); PDFSetRowHeight( szaspect ); MPDFDisable(); ninputlen = (PDFSIZET)lstrlen( datastr ); MakeMemoryObject( &g_macroobjin, PDFINPUT, (LPSTR)dataStr ); uint16 wparam = 0; uint32 lparam = MakeLParam( ndpi, xscale ); wparam = DIB_ADDFILEHEADER; /* if ( psettings->nwshave ) wparam = ShaveWidthOption( psettings->nwshave ); if ( psettings->nhshave ) wparam = ShaveHeightOption( psettings->nhshave ); */ PDFOutputAsDIB( lparam, wparam ); return ninputlen; int EncodeData(LPCTSTR datastr, BYTE * rt, unsigned short rownum, unsigned short colnum, unsigned short ecc, UINT xscale, UINT yscale) { PDFSIZET ninputlen = Encode(dataStr, rownum, colnum, ecc, xscale, yscale); BOOL fstatus; PDFSIZET rtsize = -1; //MakeFilenameObject( &g_macroobjout, PDFOUTPUT, filestr); MakeMemoryObject( &g_macroobjout, PDFOUTPUT, (LPVOID) rt); 210 FORCS Co., LTD

if ( PDFEncode( &g_macroobjin, ninputlen ) >= 0 ) { fstatus = (PDFMakeImage( &g_macroobjout, &rtsize ) == 0); else{ fstatus = FALSE; if(!fstatus){ rtsize = -1; PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); //printf(datastr); return rtsize; LPPICTURE EncodePrint(LPCTSTR datastr, unsigned short rownum, unsigned short colnum, unsigned short ecc, UINT xscale, UINT yscale) { PDFSIZET ninputlen = Encode(dataStr, rownum, colnum, ecc, xscale, yscale); BOOL fstatus; PDFSIZET rtsize = -1; HGLOBAL hglobal = NULL; DWORD dwfilesize = 1024*10; LPVOID pvdata = NULL; // alloc memory based on file size hglobal = GlobalAlloc(GMEM_MOVEABLE, dwfilesize); if(null == hglobal){ PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); return NULL; pvdata = GlobalLock(hGlobal); if(null == pvdata){ PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); return NULL; MakeMemoryObject( &g_macroobjout, PDFOUTPUT, pvdata); if ( PDFEncode( &g_macroobjin, ninputlen ) >= 0 ) { fstatus = (PDFMakeImage( &g_macroobjout, &rtsize ) == 0); else{ fstatus = FALSE; if(!fstatus){ FORCS Co., LTD 211

OZ API Developer's Guide (for Java) PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); GlobalUnlock(hGlobal); return NULL; GlobalUnlock(hGlobal); LPSTREAM pstm = NULL; // create IStream* from global memory HRESULT hr = CreateStreamOnHGlobal(hGlobal, TRUE, &pstm); if(!succeeded(hr) pstm == NULL){ PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); return NULL; // Create IPicture from image file LPPICTURE gppicture = NULL; hr = ::OleLoadPicture(pstm, dwfilesize, FALSE, IID_IPicture, (LPVOID *)&gppicture); if(!succeeded(hr) gppicture == NULL){ BOOL b1 = hr == E_POINTER; BOOL b2 = hr == E_NOINTERFACE; BOOL b3 = hr == E_OUTOFMEMORY; BOOL b4 = hr == E_UNEXPECTED; pstm->release(); PDFAbort( &g_macroobjin ); PDFAbort( &g_macroobjout); return NULL; pstm->release(); return gppicture; //////////////////////////////////////////////////////////////////////// // //Note! // //If this DLL is dynamically linked against the MFC //DLLs, any functions exported from this DLL which //call into MFC must have the AFX_MANAGE_STATE macro //added at the very beginning of the function. // //For example: // //extern "C" BOOL PASCAL EXPORT ExportedFunction() 212 FORCS Co., LTD

//{ //AFX_MANAGE_STATE(AfxGetStaticModuleState()); // normal function body here // // //It is very important that this macro appear in each //function, prior to any calls into MFC. This means that //it must appear as the first statement within the //function, even before any object variable declarations //as their constructors may generate calls into the MFC //DLL. // //Please see MFC Technical Notes 33 and 58 for additional //details. // ///////////////////////////////////////////////////////////////////////////// // CHanjaApp BEGIN_MESSAGE_MAP(CPdf417App, CWinApp) //{{AFX_MSG_MAP(CPdf417App) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPdf417App construction CPdf417App::CPdf417App() { // TODO: add construction code here, // Place all significant initialization in InitInstance ///////////////////////////////////////////////////////////////////////////// // The one and only CPdf417App object CPdf417App theapp; ///////////////////////////////////////////////////////////////////////////// // The one and only OZPdf417Comp object class OZPdf417Comp{ public: ////////////////////////////// //constructor OZPdf417Comp(); FORCS Co., LTD 213

OZ API Developer's Guide (for Java) ////////////////////////////// ////////////////////////////// //copy constructor OZPdf417Comp(OZPdf417Comp & cp); ////////////////////////////// ////////////////////////////// //destructor virtual ~OZPdf417Comp(); ////////////////////////////// ////////////////////////////// //function for Attributes int getattrlistlength(); BOOL getattrlist(tchar** attrs, const int length); int getattrlength(cstring name); BOOL getattr(cstring name, TCHAR* value, const int value_length); BOOL setattr(cstring name, CString value); char* writeme(int * length); void readme(const char* pdata, const int length); ////////////////////////////// ////////////////////////////// //function for paint void paint(hdc hdc, CString data, const float x, const float y, const float w, const float h, const float scale); ////////////////////////////// ////////////////////////////// //function for print void print(hdc hdc, CString data, const float x, const float y, const float w, const float h, const float scale, const float x_offset, const float y_offset); ////////////////////////////// ////////////////////////////// //function for autosize void getautosize(hdc hdc, CString data, float * w, float * h); ////////////////////////////// private: ////////////////////////////// //Attributes int rownum; int colnum; int ecc; int xscale; int yscale; ////////////////////////////// ; ///////////////////////////////////////////////////////////////////////// // c api for oz viewer 214 FORCS Co., LTD

#ifdef cplusplus extern "C" { #endif declspec( dllexport ) DWORD cdecl GetNewInstance() { return (DWORD)(void*)new OZPdf417Comp(); declspec( dllexport ) DWORD cdecl GetCopyInstance(DWORD src) { return (DWORD)(void*)new OZPdf417Comp(*((OZPdf417Comp *)(void *)src)); declspec( dllexport ) void cdecl DeleteInstance(DWORD src) { delete ((OZPdf417Comp *)(void *)src); //////////////////////////////////////////////////////////////////////// declspec( dllexport ) int cdecl getattrlistlength(dword src) { return ((OZPdf417Comp *)(void *)src)->getattrlistlength(); declspec( dllexport ) BOOL cdecl getattrlist(dword src, TCHAR** attrs, const int length){ return ((OZPdf417Comp *)(void *)src)->getattrlist(attrs, length); declspec( dllexport ) int cdecl getattrlength(dword src, const TCHAR* name) { return ((OZPdf417Comp *)(void *)src)->getattrlength(name); declspec( dllexport ) BOOL cdecl getattr(dword src, const TCHAR* name, TCHAR* value, const int value_length){ return ((OZPdf417Comp *)(void *)src)->getattr(name, value, value_length); declspec( dllexport ) BOOL cdecl setattr(dword src, const TCHAR* name, const TCHAR* value) { return ((OZPdf417Comp *)(void *)src)->setattr(name, value); declspec( dllexport ) char* cdecl writeme(dword src, int * length) { return ((OZPdf417Comp *)(void *)src)->writeme(length); declspec( dllexport ) void cdecl readme(dword src, const char* pdata, const int length) { ((OZPdf417Comp *)(void *)src)->readme(pdata, length); FORCS Co., LTD 215

OZ API Developer's Guide (for Java) declspec( dllexport ) void cdecl paint(dword src, HDC hdc, LPCTSTR data, const float x, const float y, const float w, const float h, const float scale) { ((OZPdf417Comp *)(void *)src)->paint(hdc, data, x, y, w, h, scale); declspec( dllexport ) void cdecl print(dword src, HDC hdc, LPCTSTR data, const float x, const float y, const float w, const float h, const float scale, const float x_offset, const float y_offset) { ((OZPdf417Comp *)(void *)src)->print(hdc, data, x, y, w, h, scale, x_offset, y_offset); declspec( dllexport ) void cdecl getautosize(dword src, HDC hdc, LPCTSTR data, float * w, float * h) { ((OZPdf417Comp *)(void *)src)->getautosize(hdc, data, w, h); #ifdef cplusplus #endif //////////////////////////////////////////////////////////////////////////// // int to string convert function CString _tostring(int i){ CString rst; rst.format(_t("%d"), i); return rst; ///////////////////////////////////////////////////////////////////////// // OZPdf417Comp implement ////////////////////////////// //constructor OZPdf417Comp::OZPdf417Comp(){ rownum = 0; colnum = 8; ecc = 0; xscale = 1; yscale = 1; ////////////////////////////// ////////////////////////////// //copy constructor OZPdf417Comp::OZPdf417Comp(OZPdf417Comp & comp){ rownum = comp.rownum; colnum = comp.colnum; ecc = comp.ecc; xscale = comp.xscale; 216 FORCS Co., LTD

yscale = comp.yscale; ////////////////////////////// ////////////////////////////// //destructor OZPdf417Comp::~OZPdf417Comp(){ ////////////////////////////// int OZPdf417Comp::getAttrListLength(){ // Attribute count return return 5; BOOL OZPdf417Comp::getAttrList(TCHAR** attrs, const int length){ // Attribute names set to attrs // length is result of getattrlistlength() function call if(length < 0)return FALSE; int nindex = 0; if(length == nindex)return TRUE; attrs[nindex++] = _T("PDF417_ROWNUM"); if(length == nindex)return TRUE; attrs[nindex++] = _T("PDF417_COLNUM"); if(length == nindex)return TRUE; attrs[nindex++] = _T("PDF417_ECC"); if(length == nindex)return TRUE; attrs[nindex++] = _T("PDF417_XSCALE"); if(length == nindex)return TRUE; attrs[nindex++] = _T("PDF417_YSCALE"); return TRUE; int OZPdf417Comp::getAttrLength(CString name){ // name is Attribute name // return TCHAR length of value by name CString value; if(name == "PDF417_ROWNUM"){ value = _tostring(rownum); else if(name == "PDF417_COLNUM"){ value = _tostring(colnum); else if(name == "PDF417_ECC"){ value = _tostring(ecc); else if(name == "PDF417_XSCALE"){ value = _tostring(xscale); else if(name == "PDF417_YSCALE"){ value = _tostring(yscale); ///////////////////////////////////////////////////// else{ return -1; FORCS Co., LTD 217

OZ API Developer's Guide (for Java) return value.getlength()+1; BOOL OZPdf417Comp::getAttr(CString name, TCHAR* valuebuffer, const int value_length){ // name is Attribute name // Attribute value set to valuebuffer // value_length is result of getattrlength() function call CString value; if(name == _T("PDF417_ROWNUM")){ value = _tostring(rownum); else if(name == _T("PDF417_COLNUM")){ value = _tostring(colnum); else if(name == _T("PDF417_ECC")){ value = _tostring(ecc); else if(name == _T("PDF417_XSCALE")){ value = _tostring(xscale); else if(name == _T("PDF417_YSCALE")){ value = _tostring(yscale); ///////////////////////////////////////////////////// else{ // return false if can`t find attribute return FALSE; if(value.getlength() >= value_length-1){ // return false if length is differ return FALSE; _tcscpy(valuebuffer, value); return TRUE; BOOL OZPdf417Comp::setAttr(CString name, CString value){ // name is Attribute name // value is Attribute value if(name == _T("PDF417_ROWNUM")){ rownum = _ttoi(value); else if(name == _T("PDF417_COLNUM")){ colnum = _ttoi(value); else if(name == _T("PDF417_ECC")){ ecc = _ttoi(value); else if(name == _T("PDF417_XSCALE")){ xscale = _ttoi(value); else if(name == _T("PDF417_YSCALE")){ yscale = _ttoi(value); else{ // return false if can`t find attribute return FALSE; 218 FORCS Co., LTD

return TRUE; char* OZPdf417Comp::writeMe(int * length){ // serialize functin // binary length set to length // return my binary *length = 20; char* pdata = new char[*length]; int i = 0; pdata[i++] = (char)((rownum & 0xFF000000) >> 24); pdata[i++] = (char)((rownum & 0x00FF0000) >> 16); pdata[i++] = (char)((rownum & 0x0000FF00) >> 8); pdata[i++] = (char)((rownum & 0x000000FF)); pdata[i++] = (char)((colnum & 0xFF000000) >> 24); pdata[i++] = (char)((colnum & 0x00FF0000) >> 16); pdata[i++] = (char)((colnum & 0x0000FF00) >> 8); pdata[i++] = (char)((colnum & 0x000000FF)); pdata[i++] = (char)((ecc & 0xFF000000) >> 24); pdata[i++] = (char)((ecc & 0x00FF0000) >> 16); pdata[i++] = (char)((ecc & 0x0000FF00) >> 8); pdata[i++] = (char)((ecc & 0x000000FF)); pdata[i++] = (char)((xscale & 0xFF000000) >> 24); pdata[i++] = (char)((xscale & 0x00FF0000) >> 16); pdata[i++] = (char)((xscale & 0x0000FF00) >> 8); pdata[i++] = (char)((xscale & 0x000000FF)); pdata[i++] = (char)((yscale & 0xFF000000) >> 24); pdata[i++] = (char)((yscale & 0x00FF0000) >> 16); pdata[i++] = (char)((yscale & 0x0000FF00) >> 8); pdata[i++] = (char)((yscale & 0x000000FF)); return pdata; void OZPdf417Comp::readMe(const char* pdata, const int length){ // serialize functin // pdata is result of writeme() function call // length is result of writeme() function call // length is binary length if(length!= 20){ throw new CException(0); int i = 0; rownum = ((pdata[i++] << 24) + (pdata[i++] << 16) + (pdata[i++] << 8) + (pdata[i++] << 0)); FORCS Co., LTD 219

OZ API Developer's Guide (for Java) colnum = ((pdata[i++] << 24) + (pdata[i++] << 16) + (pdata[i++] << 8) + (pdata[i++] << 0)); ecc = ((pdata[i++] << 24) + (pdata[i++] << 16) + (pdata[i++] << 8) + (pdata[i++] << 0)); xscale = ((pdata[i++] << 24) + (pdata[i++] << 16) + (pdata[i++] << 8) + (pdata[i++] << 0)); yscale = ((pdata[i++] << 24) + (pdata[i++] << 16) + (pdata[i++] << 8) + (pdata[i++] << 0)); void OZPdf417Comp::paint(HDC hdc, CString data, const float x, const float y, const float w, const float h, const float scale){ // hdc is device context handle // data is component caption // x and y are component pixel positon // w and h are component pixel size // scale is extension ratio. (1.0f 1.5f 2.0f etc...) //(int)(x*scale) and (int)(y*scale) are real position in HDC LPPICTURE gppicture = EncodePrint(data, rownum,colnum,ecc,xscale,yscale);// if(gppicture == NULL) return; long hmwidth; long hmheight; gppicture->get_width(&hmwidth); gppicture->get_height(&hmheight); // convert himetric to pixelsa int imagewidth; int imageheight; imagewidth= MulDiv(hmWidth*72, GetDeviceCaps(hDC, LOGPIXELSX), 2540*96); imageheight= MulDiv(hmHeight*72, GetDeviceCaps(hDC, LOGPIXELSY), 2540*96); imagewidth = (int)(imagewidth*scale); imageheight = (int)(imageheight*scale); RECT rc = { 0, 0, imagewidth, imageheight ; HRESULT hesult = gppicture->render(hdc, (int)(x*scale), (int)(y*scale), imagewidth, imageheight, 0, hmheight, hmwidth, -hmheight, &rc); gppicture->release(); void OZPdf417Comp::print(HDC hdc, CString data, const float x, const float y, const float w, const float h, const float scale, const float x_offset, const float y_offset){ // hdc is device context handle // data is component caption // x and y are component pixel positon // w and h are component pixel size // scale is extension ratio. 220 FORCS Co., LTD

// x_offset and y_offset are print offset //(int)(x*scale+x_offset) and (int)(y*scale+y_offset) are real position in HDC LPPICTURE gppicture = EncodePrint(data, rownum,colnum,ecc,xscale,yscale);// if(gppicture == NULL) return; long hmwidth; long hmheight; gppicture->get_width(&hmwidth); gppicture->get_height(&hmheight); // convert himetric to pixelsa int imagewidth; int imageheight; imagewidth= MulDiv(hmWidth, GetDeviceCaps(hDC, LOGPIXELSX), 2540); imageheight= MulDiv(hmHeight, GetDeviceCaps(hDC, LOGPIXELSY), 2540); RECT rc = { 0, 0, imagewidth, imageheight ; HRESULT hesult = gppicture->render(hdc, (int)(x*scale+x_offset), (int)(y*scale+y_offset), imagewidth, imageheight, 0, hmheight, hmwidth, -hmheight, &rc); gppicture->release(); void OZPdf417Comp::getAutosize(HDC hdc, CString data, float * w, float * h){ // hdc is device context handle // data is component caption // *w and *h are component pixel size // prefered size may set to w and h (*w = 100; *h = 150;) LPPICTURE gppicture = EncodePrint(data, rownum,colnum,ecc,xscale,yscale);// if(gppicture == NULL) return; long hmwidth; long hmheight; gppicture->get_width(&hmwidth); gppicture->get_height(&hmheight); // convert himetric to pixelsa *w = (float)muldiv(hmwidth*72, GetDeviceCaps(hDC, LOGPIXELSX), 2540*96); *h = (float)muldiv(hmheight*72, GetDeviceCaps(hDC, LOGPIXELSY), 2540*96); gppicture->release(); FORCS Co., LTD 221

OZ API Developer's Guide (for Java) 222 FORCS Co., LTD

SchedulerCom FORCS Co., LTD 223

OZ API Developer's Guide (for Java) Scheduler API makepdf export ASP SchedulerCom makepdf export ASP. SchedulerCom Com -.Init Argument.Init() COM. -.Clean Argument.Clean() COM. -.SetServerType.SetServerType String ServerType. Argument ServerType "TCP" "Servlet" "TCP" "Servlet" () -.SetServerIP.SetServerIP String IP IP. Argument IP IP ex) "127.0.0.1" 224 FORCS Co., LTD

-.SetServerPort.SetServerPort String Port Port. Argument Port Port ex) "8003" -.SetServerURL.SetServerURL String URL URL. Argument URL URL ex) "http://localhost:7001/oz/server" -.SetSchedulerIP.SetSchedulerIP String IP IP. Argument IP IP ex) "127.0.0.1" -.SetSchedulerPort.SetSchedulerPort String Port Port. Argument Port Port ex) "9521" -.SetUser.SetUser String UserID. Argument UserID ex) "admin" -.SetPassword.SetPassword String Password. Argument Password ex) "admin" FORCS Co., LTD 225

OZ API Developer's Guide (for Java) Key -.SetProperty.SetProperty String Key, String Value,. Argument Key Value Key : ".SetProperty" Key Value Key Value "launch_type" "report_name" "category_name" "Immediately" "" "/<Category>" Scheduler Task, "Immediately". (.ozr).. "export.confirmsave" "false" "false". "parameter_count" "parameter_name_<index>" " " "" ODI. : "0".. "[FORM]." ODI "ODI.". "parameter_value_<index>" " ". : ".SetProperty" Key "launch_type", "report_name", "category_name", "export.confirmsave", "parameter_count". 226 FORCS Co., LTD

-.SetExportProperty Argument.SetExportProperty String Key, String Value. Key Key Value : ".SetExportProperty" Key Value Key Value "connection.server" "connection.port" "connection.servlet" "connection.reportname" " IP" " Port" " URL" " " IP. Port. URL.. "connection.fetchtype" "BATCH". "connection.pcount" "connection.args<index>= " "odi.odinames" "odi.odi.pcount", "odi.odi.args<index>" " " " " "ODI,ODI,.." " " "= ".. ODI. ODI ODI (","). ODI.. FORCS Co., LTD 227

OZ API Developer's Guide (for Java) "export.format" "<ozd/html/jpg/xls/doc/svg/ txt/ppt/tif/csv>.filename" "viewer.childcount" " " "" " " "/". "ozd/html/jpg/xls/doc/svg/txt /ppt/tif/csv". ex).setexportproperty "ozd.filename", "test.ozd". : Key "child<index>.". ex) "child1.connection.server" ex) "child1.connection.port" -.MakePDF.MakePDF(String ExportType) pdf. : "ViewType" "None". "SHOW" PC PDF Reader pdf. Argument ExportType "ATTACH" pdf. "NONE" pdf,. -.Export.Export() Argument pdf, ozd, html, jpg, xls, doc, svg, txt, ppt, tif, csv. : "ViewType" "None". 228 FORCS Co., LTD

-.IsExportSuccessed.IsExportSuccessed(). Return true false -.ShowMessage.ShowMessage(String Msg). Argument Msg SchedulerCom "SchedulerCom" MS. SchedulerCOM.dll "SchedulerCom" "SchedulerCOM.dll". "SchedulerCOM.dll" "C:\OZServer\Scheduler\" regsvr32 " C:\OZServer\Scheduler\SchedulerCOM.dll". MakePDF Export,. "scheduler_server.properties" "RepositoryFileRootPath". FORCS Co., LTD 229

OZ API Developer's Guide (for Java) MakePDF ASP <% Dim Com Set Com = Server.CreateObject("SchedulerCOM.CSchedulerCall.1") If Not IsObject (Com) Then Response.Write("PDF File.") Response.End Else With Com 'Init. COM.Init() ' TCP-Daemon Type Server.SetServerType "TCP".SetServerIP "127.0.0.1".SetServerPort "8003" ' Servlet Type Server '.SetServerType "Servlet" '.SetServerURL "http://localhost:7001/oz/server" ' Set Scheduler Info..SetSchedulerIP "127.0.0.1".SetSchedulerPort "9521" ' set User Info..SetUser "admin".setpassword "admin" ' set Launch Type.SetProperty "launch_type", "Immediately" ' set Report Info..SetProperty "report_name", "parameter_test.ozr".setproperty "category_name", "/".SetProperty "export.confirmsave", "false" ' with NO parameter..setproperty "parameter_count", "0" 230 FORCS Co., LTD

' with parameters. '.setproperty "parameter_count", "4" '.setproperty "parameter_name_1", "[FORM].formparam1" '.setproperty "parameter_value_1", "PARAM 1" '.setproperty "parameter_name_2", "[FORM].formparam2" '.setproperty "parameter_value_2", "PARAM 2" '.setproperty "parameter_name_3", "parameter_test.odiparam1" '.setproperty "parameter_value_3", "PARAM 3" '.setproperty "parameter_name_4", "parameter_test.odiparam2" '.setproperty "parameter_value_4", "PARAM 4" ' set Export Info..setExportProperty "pdf.filename", "PDF_TEST.pdf".MakePDF("NONE") res =.IsExportSuccessed() if res = "true" then.showmessage ("successed...") else.showmessage ("failed...") end if.clean() End With Set Com = Nothing End If %> Export ASP <% Dim Com Set Com = Server.CreateObject("SchedulerCOM.CSchedulerCall.1") If Not IsObject (Com) Then Response.Write("File.") FORCS Co., LTD 231

OZ API Developer's Guide (for Java) Response.End Else With Com.Init().SetServerType "TCP".SetServerIP "127.0.0.1".SetServerPort "8003".SetSchedulerIP "127.0.0.1".SetSchedulerPort "9521".SetUser "admin".setpassword "admin".setproperty "launch_type", "Immediately".setProperty "cfg.type","new".setexportproperty "connection.server", "127.0.0.1".setExportProperty "connection.port", "8003".setExportProperty "connection.reportname", "/parameter_test.ozr".setexportproperty "connection.fetchtype", "BATCH".setExportProperty "connection.pcount", "2".setExportProperty "connection.args1=formparam1", "form1".setexportproperty "connection.args2=formparam2", "form2".setexportproperty "odi.parameter_test.args1", "odiparam1=odi1".setexportproperty "odi.parameter_test.args2", "odiparam2=odi2".setexportproperty "odi.parameter_test.pcount", "2".setExportProperty "odi.odinames", "parameter_test".setexportproperty "export.format", "ozd/html/jpg/xls/doc/svg/txt/ppt/tif/csv".setexportproperty "ozd.filename", "test.ozd".setexportproperty "html.filename", "test.html".setexportproperty "jpg.filename", "test.jpg".setexportproperty "excel.filename", "test.xls".setexportproperty "word.filename", "test.doc".setexportproperty "svg.filename", "test.svg".setexportproperty "text.filename", "test.txt".setexportproperty "ppt.filename", "test.ppt".setexportproperty "tiff.filename", "test.tif".setexportproperty "csv.filename", "test.csv".setexportproperty "viewer.childcount", "1".setExportProperty "child1.connection.server", "127.0.0.1".setExportProperty "child1.connection.port", "8003" 232 FORCS Co., LTD

.setexportproperty "child1.connection.reportname", "/parameter_test.ozr".setexportproperty "child1.connection.fetchtype", "BATCH".setExportProperty "child1.connection.pcount", "2".setExportProperty "child1.connection.args1=formparam1", "form1".setexportproperty "child1.connection.args2=formparam2", "form2".setexportproperty "child1.odi.parameter_test.args1", "odiparam1=odi1".setexportproperty "child1.odi.parameter_test.args2", "odiparam2=odi2".setexportproperty "child1.odi.parameter_test.pcount", "2".setExportProperty "child1.odi.odinames", "parameter_test".setexportproperty "child1.export.format", "ozd/html/jpg/xls/doc/svg/txt/ppt/tif/csv".setexportproperty "child1.ozd.filename", "child_test.ozd".setexportproperty "child1.html.filename", "child_test.html".setexportproperty "child1.jpg.filename", "child_test.jpg".setexportproperty "child1.excel.filename", "child_test.xls".setexportproperty "child1.word.filename", "child_test.doc".setexportproperty "child1.svg.filename", "child_test.svg".setexportproperty "child1.text.filename", "child_test.txt".setexportproperty "child1.ppt.filename", "child_test.ppt".setexportproperty "child1.tiff.filename", "child_test.tif".setexportproperty "child1.csv.filename", "child_test.csv".export() Response.Write(.IsExportSuccessed()).Clean() End With Set Com = Nothing End If %> FORCS Co., LTD 233

OZ API Developer's Guide (for Java) 234 FORCS Co., LTD

Servlet API FORCS Co., LTD 235

OZ API Developer's Guide (for Java) Servlet API,. Servlet API(ozsdmapi.jar) Servlet API,., OZR, OZA. URL POST ODI.,, DataAction DataAction POST URL, DataAction "ok" "success". Servlet API ODI DB (UDS),. POST,, POST POST. POST _OZ_ODIFetchType OZ_ODIITEM OZ_ODICATEGORY_ Fetch DM_BATCH_FETCH DM_CONCURRENT_FETCH FetchUnit DM_PER_DATASET Fetch DM_CONCURRENT_FETCH. ODI ODI 236 FORCS Co., LTD

_OZ_DATASET_ MyParam FetchUnit DM_PER_DATASET. ODI. DataAction POST MyParam _OZ_DAC_CNT <INDEX>.DATASET <INDEX>.TYPE <INDEX>.EXT <INDEX>.SRC_CNT <INDEX>.SF_<INDEX2> <INDEX>.SV_<INDEX2> <INDEX>.TRG_CNT <INDEX>.DF_<INDEX2> <INDEX>.DV_<INDEX2> odi. DataAction <INDEX>. DataAction DataAction CUD Insert, Delete, RowUpdate DataAction Extra DataAction Source <INDEX2>. DataAction <INDEX2> SourceName DataAction <INDEX2> SourceValue DataAction Target <INDEX2>. DataAction <INDEX2> TargetName DataAction <INDEX2> TargetValue : 3 ODI, DataAction 3 Commit POST parama=somevalue paramb=somevalue paramc=somevalue _OZ_DAC_CNT=3 0.DATASET=dataset1 0.TYPE=Insert 0.EXT= 0.SRC_CNT=2 0.SF_0=FieldName1 0.SV_0=a 0.SF_1=FieldName2 0.SV_1=b 1.DATASET=dataset1 1.TYPE=Delete 1.EXT= 1.TRG_CNT=1 1.DF_0=FieldName1 FORCS Co., LTD 237

OZ API Developer's Guide (for Java) 1.DV_0=a 2.DATASET=dataset1 2.TYPE=RowUpdate 2.EXT= 2.SRC_CNT=2 2.SF_0=FieldName1 2.SV_0=newvalue 2.SF_1=FieldName2 2.SV_1=oldvalue 2.TRG_CNT=2 2.DF_0=FieldName1 2.DV_0=newvalue 2.DF_1=FieldName2 2.DV_1=oldvalue Servlet API DataModuleFactory - getdatamodule public static DataModule getdatamodule(string FetchType) throws OZSDMException Fetch. Argument FetchType Fetch DM_CONCURRENT_FETCH DM_BATCH_FETCH DataModule - init public void init(outputstream out) throws IOException Stream. Argument out Response OutputStream - startbindding public void startbinding() throws IOException, SQLException 238 FORCS Co., LTD

.. - endbindding public void endbinding() throws IOException, SQLException.. - startset public void startset(string DatasetName) throws IOException.. Argument DatasetName - endset public void endset(string DatasetName) throws IOException. Argument DatasetName - makesdm_set public void makesdm_set(string DatasetName, ResultSet rs, OutputStream out) throws OZSDMException, IOException DM_PER_DATASET SDM. Argument DatasetName rs out ResultSet Response OutputStream - addparameter public void addparameter(string ParamName, int FieldType, Object Value). Argument ParamName FieldType FORCS Co., LTD 239

OZ API Developer's Guide (for Java) Value - addsetinfo public void addsetinfo(string DatasetName, String MasterDatasetName, String[] FieldNames, int[] FieldTypes) throws IllegalArgumentException. Argument DatasetName MasterDatasetName FieldNames FieldTypes, "" - addrow public void addrow(string DatasetName, HashMap hmap) throws IOException, SQLException ResultSet Row. DatasetName Argument hmap HashMap Row )... rs = stmt.executequery(query); while(rs.next()) { HashMap hmap = new HashMap(); hmap.put(_fn[0], rs.getstring(_fn[0])); hmap.put(_fn[1], rs.getstring(_fn[1])); hmap.put(_fn[2], rs.getstring(_fn[2])); hmap.put(_fn[3], rs.getstring(_fn[3])); hmap.put(_fn[4], rs.getstring(_fn[4])); hmap.put(_fn[5], rs.getstring(_fn[5])); module.addrow("set_1", hmap);... 240 FORCS Co., LTD

- addrow public void addrow(string DatasetName, List list) throws IOException, SQLException ResultSet Row. Argument DatasetName list ArrayList Row - addrow public void addrow(string DatasetName, String[] arr) throws IOException, SQLException ResultSet Row. Argument DatasetName arr String[] Row - sendbinderrormessage public void sendbinderrormessage(string msg) throws IOException.,. Argument msg - senderrormessage public void senderrormessage(string msg, OutputStream out) throws IOException.,. Argument msg out Response OutputStream FORCS Co., LTD 241

OZ API Developer's Guide (for Java) Servlet API 1 : Application -, DataAction Servlet API Table,,, Servlet API ozsdmapi.jar, DataAction UDS,, ODI. Step 1 ozsdmapi.jar Servlet API ozsdmapi.jar. Tomcat 5.0 webapps\root\web-inf\lib ozsdmapi.jar. Step 2. java DataModuleSampleServlet.class. package sample; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.util.*; import oz.framework.api.datamodule; import oz.uds.rs.listmapresultset; import oz.sdm.datamodulefactory; import oz.uds.rs.listmapresultset; /** * <p>title: OZ SDM API</p> * <p>description: </p> * <p>copyright: Copyright (c) 2005</p> * <p>company: </p> * @author Forcs * @version 1.0 */ public class DataModuleSampleServlet extends HttpServlet { private static final String _KEY_ODI_FETCH_TYPE = "_OZ_ODIFetchType_"; private static final String _KEY_ODIITEM = "_OZ_ODIITEM_"; private static final String _KEY_ODICATEGORY = "_OZ_ODICATEGORY_"; private static final String _KEY_OZ_DATASET_ = "_OZ_DATASET_"; private Connection m_conn = null; public void init(servletconfig config) throws ServletException { 242 FORCS Co., LTD

super.init(config); public void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { process(request, response); public void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { process(request, response); private void process(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { // init connection. try { String _URL = "jdbc:odbc:ozdemokr30"; Properties prop = new Properties(); prop.put("user", ""); prop.put("password", ""); Driver driver = (Driver) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); m_conn = driver.connect(_url, prop); String aaa = null; catch(exception e) { DataModule.sendErrorMessage("connection error...",response.getoutputstream()); throw new ServletException(e.getMessage()); try { System.out.println("--------------------"); Enumeration enum = request.getparameternames(); while (enum.hasmoreelements()) { String temp = (String) enum.nextelement(); System.out.println("name=" + temp + " value=" + getencode(request.getparameter(temp))); // ------------------------------------------------------------ --------- // fetch parameters // "DM_BATCH_FETCH DM_CONCURRENT_FETCH" String odifetchtype = getencode(request.getparameter( _KEY_ODI_FETCH_TYPE)); String item = getencode(request.getparameter(_key_odiitem)); String category = getencode(request.getparameter(_key_odicategory)); String dataset = getencode(request.getparameter(_key_oz_dataset_)); // ------------------------------------------------------------ --------- if (odifetchtype == null) odifetchtype = "DM_CONCURRENT_FETCH"; if ( (dataset == null) (dataset.length() == 0)) { // ODI FetchUnit DM_PER_DATAMODULE. if (item.equals("jasmin_sample3.odi")) { // Master-Detail Sample. Master_Detail_Style(request, response, odifetchtype); else if (item.equals("jasmin_sample2.odi") (item.equals("jasmin_sample4.odi"))) { // SET Sample. System.out.println("default..."); FORCS Co., LTD 243

OZ API Developer's Guide (for Java) default_style(request, response, odifetchtype); else { DataModule.sendErrorMessage("unsupported odi error...", response.getoutputstream()); throw new ServletException("Unknown Item :" + item); else { // ODI FetchUnit DM_PER_DATASET. // odifetchtype DM_CONCURRENT_FETCH. //. if (odifetchtype.equalsignorecase("dm_concurrent_fetch")) { this.set_style(request, response, "DM_CONCURRENT_FETCH"); else { DataModule.sendErrorMessage("unsupported error...", response.getoutputstream()); throw new ServletException("unsupported"); if (m_conn!= null) { try { m_conn.close(); catch (Exception e) { catch(exception ex){ // senderrormessage // throw. client DataModule.sendErrorMessage(ex.getMessage(), response.getoutputstream()); throw new ServletException(ex.getMessage()); private void Master_Detail_Style(HttpServletRequest request, HttpServletResponse response, String fetchtype) throws ServletException, IOException { Statement stmt1 = null; Statement stmt4 = null; ResultSet rs1 = null; ResultSet rs4 = null; DataModule module = null; // jasmin/jasmin_sample1.odi // SET_1 String[] _FN1 = {"FirstName" ; int[] _FT1 = {java.sql.types.varchar ; // SET_4 String[] _FN4 = {"ContactId", "FirstName", "LastName", "Phone", "Fax", "Email", "OrgUnitId", "UserName" ; int[] _FT4 = {4, 12, 12, 12, 12, 12, 5, 12 ; try { module = DataModuleFactory.getDataModule(fetchType); module.init(response.getoutputstream()); // set SET Info. module.addsetinfo("set_1", "", _FN1, _FT1); module.addsetinfo("set_4", "SET_1", _FN4, _FT4); catch(exception ex) { throw new ServletException(ex.getMessage()); try { module.startbinding(); 244 FORCS Co., LTD

String query1 = "select distinct FirstName from contact"; module.startset("set_1"); stmt1 = m_conn.createstatement(); rs1 = stmt1.executequery(query1); while(rs1.next()) { String f1 = rs1.getstring(_fn1[0]); HashMap map1 = new HashMap(); map1.put(_fn1[0], f1); module.addrow("set_1", map1); String query4 = "select * from contact where FirstName='" + f1 + "' order by contactid"; module.startset("set_4"); stmt4 = m_conn.createstatement(); rs4 = stmt4.executequery(query4); while(rs4.next()) { HashMap map4 = new HashMap(); map4.put(_fn4[0], new Integer(rs4.getInt(_FN4[0]))); map4.put(_fn4[1], rs4.getstring(_fn4[1])); map4.put(_fn4[2], rs4.getstring(_fn4[2])); map4.put(_fn4[3], rs4.getstring(_fn4[3])); map4.put(_fn4[4], rs4.getstring(_fn4[4])); map4.put(_fn4[5], rs4.getstring(_fn4[5])); map4.put(_fn4[6], new Integer(rs4.getInt(_FN4[6]))); map4.put(_fn4[7], rs4.getstring(_fn4[7])); module.addrow("set_4", map4); rs4.close(); rs4 = null; stmt4.close(); stmt4 = null; module.endset("set_4"); rs1.close(); rs1 = null; stmt1.close(); stmt1 = null; module.endset("set_1"); module.endbinding(); catch(exception e) { e.printstacktrace(); // sendbinderrormessage. if(module!= null) { module.sendbinderrormessage(e.tostring()); finally { if(rs1!= null) { try { rs1.close(); catch(exception e) { if(stmt1!= null) { try { stmt1.close(); catch(exception e) { if(rs4!= null) { try { rs4.close(); catch(exception e) { if(stmt4!= null) { try { stmt4.close(); catch(exception e) { private void default_style(httpservletrequest request, HttpServletResponse response, String fetchtype) throws ServletException, IOException { System.out.println("select time=="+system.currenttimemillis()); Statement stmt = null; ResultSet rs = null; DataModule module = null; FORCS Co., LTD 245

OZ API Developer's Guide (for Java) // jasmin/jasmin_sample2.odi // SET_1 String[] _FN = {"CarID", "Maker", "EMaker", "CarName", "ECarName", "CarImageFile"; int[] _FT = { java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar ; try { module = DataModuleFactory.getDataModule(fetchType); module.init(response.getoutputstream()); // module.init(output); // set Parameter Info. module.addparameter("param1", java.sql.types.varchar, getencode(request.getparameter("param1"))); module.addparameter("param2", java.sql.types.varchar, getencode(request.getparameter("param2"))); // set SET Info. module.addsetinfo("set_1", "", _FN, _FT); catch(exception ex){ throw new ServletException(ex.getMessage()); try { module.startbinding(); String query = "select * from car"; module.startset("set_1"); stmt = m_conn.createstatement(); rs = stmt.executequery(query); while(rs.next()) { HashMap map = new HashMap(); String a = rs.getstring(_fn[0]); String b = rs.getstring(_fn[1]); String c = rs.getstring(_fn[2]); String d = rs.getstring(_fn[3]); String e = rs.getstring(_fn[4]); String f = rs.getstring(_fn[5]); map.put(_fn[0], a); map.put(_fn[1], b); map.put(_fn[2], c); map.put(_fn[3], d); map.put(_fn[4], e); map.put(_fn[5], f); module.addrow("set_1", map); System.out.print("select FN0="+_FN[0]+" name="+a); System.out.print(" FN1="+_FN[1]+" name="+b); System.out.print(" FN2="+_FN[2]+" name="+c); System.out.print(" FN3="+_FN[3]+" name="+d); System.out.print(" FN4="+_FN[4]+" name="+e); System.out.print(" FN5="+_FN[5]+" name="+f); System.out.println(""); module.endset("set_1"); module.endbinding(); rs.close(); rs = null; stmt.close(); stmt = null; catch(exception e) { e.printstacktrace(); // sendbinderrormessage. module.sendbinderrormessage(e.tostring()); finally { OutputStream out = response.getoutputstream(); if(rs!= null) { try { rs.close(); catch(exception e) { 246 FORCS Co., LTD

if(stmt!= null) { try { stmt.close(); catch(exception e) { private void SET_Style(HttpServletRequest request, HttpServletResponse response, String fetchtype) throws ServletException, IOException { Statement stmt = null; ResultSet rs = null; DataModule module = null; try { // jasmin/jasmin_sample2.odi // SET_1 String[] _FN = {"CarID", "Maker", "EMaker", "CarName", "ECarName", "CarImageFile" ; int[] _FT = {java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar, java.sql.types.varchar,java.sql.types.varchar; module = DataModuleFactory.getDataModule(fetchType); // set Parameter Info. module.addparameter("param1", getencode(request.getparameter("param1"))); module.addparameter("param2", getencode(request.getparameter("param2"))); java.sql.types.varchar, java.sql.types.varchar, String query = "select * from car"; stmt = m_conn.createstatement(); rs = stmt.executequery(query); module.makesdm_set("set_1",rs,response.getoutputstream()); rs.close(); rs = null; stmt.close(); stmt = null; catch(exception e) { e.printstacktrace(); // set sendbinderrormessage. // makesdm_set. throw new ServletException(e.getMessage()); finally { if(rs!= null) { try { rs.close(); catch(exception e) { if(stmt!= null) { try { stmt.close(); catch(exception e) { public void destroy() { super.destroy(); private String getencode(string value) { try { return new String(value.getBytes("8859_1"), "KSC5601"); catch(exception ex){ return value; FORCS Co., LTD 247

OZ API Developer's Guide (for Java) Step 3 DataAction DataAction. java DataActionSampleServlet.class. package sample; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import java.util.*; /** * <p>title: OZ SDM API</p> * <p>description: </p> * <p>copyright: Copyright (c) 2005</p> * <p>company: </p> * @author Forcs * @version 1.0 */ public class DataActionSampleServlet extends HttpServlet { private static final String _KEY_ODI_FETCH_TYPE = "_OZ_ODIFetchType_"; private static final String _KEY_ODIITEM = "_OZ_ODIITEM_"; private static final String _KEY_ODICATEGORY = "_OZ_ODICATEGORY_"; private static final String _KEY_OZ_DATASET_ = "_OZ_DATASET_"; private static final String _KEY_OZ_DAC_CNT = "_OZ_DAC_CNT"; private static String TABLENAME = "car"; private String dac_insert_query = ""; private String dac_update_query = ""; private String dac_delete_query = ""; private PreparedStatement p_insert_stmt = null; private PreparedStatement p_update_stmt = null; private PreparedStatement p_delete_stmt = null; private Connection m_conn = null; public void init(servletconfig config) throws ServletException { super.init(config); public void dopost(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { process(request, response); public void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { process(request, response); private void process(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { try { String _URL = "jdbc:odbc:ozdemokr30"; Properties prop = new Properties(); prop.put("user", ""); prop.put("password", ""); 248 FORCS Co., LTD

Driver driver = (Driver) Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); m_conn = driver.connect(_url, prop); catch(exception ex) { response.getoutputstream().write(ex.getmessage().getbytes()); throw new ServletException(ex.getMessage()); try { dac_insert_query = ""; dac_update_query = ""; dac_delete_query = ""; Enumeration enum = request.getparameternames(); while (enum.hasmoreelements()) { String temp = (String) enum.nextelement(); System.out.println("name=" + temp + " value=" + getencode(request.getparameter(temp))); // ------------------------------------------------------------ --------- // fetch parameters // "DM_BATCH_FETCH DM_CONCURRENT_FETCH" String odifetchtype = getencode(request.getparameter( _KEY_ODI_FETCH_TYPE)); String item = getencode(request.getparameter(_key_odiitem)); String category = getencode(request.getparameter(_key_odicategory)); String dataset = getencode(request.getparameter(_key_oz_dataset_)); // ------------------------------------------------------------ --------- System.out.println("--------------------"); if (odifetchtype == null) odifetchtype = "DM_CONCURRENT_FETCH"; m_conn.setautocommit(false); //Action. int dac_cnt = Integer.parseInt(request.getParameter(_KEY_OZ_DAC_CNT)); for (int i = 0; i < dac_cnt; i++) { String type = request.getparameter(i + ".TYPE"); if (type.equalsignorecase("insert")) { insert(request, response, i); else if (type.equalsignorecase("rowupdate")) { update(request, response, i); else if (type.equalsignorecase("delete")) { delete(request, response, i); System.out.println(type+" time=="+system.currenttimemillis()); m_conn.commit(); response.getoutputstream().write(new String("OK").getBytes()); catch(exception ex){ ex.printstacktrace(); try { m_conn.rollback(); catch(exception e) { response.getoutputstream().write(ex.getmessage().getbytes()); throw new ServletException(ex.getMessage()); finally { if(p_insert_stmt!= null) { try { p_insert_stmt.close(); catch(exception e) { if(p_update_stmt!= null) { try { p_update_stmt.close(); catch(exception e) { if(p_delete_stmt!= null) { try { p_delete_stmt.close(); catch(exception e) { if (m_conn!= null) { try { m_conn.close(); catch(exception e) { FORCS Co., LTD 249

OZ API Developer's Guide (for Java) private void insert(httpservletrequest request, HttpServletResponse response, int cnt) throws Exception { int insert_source_fieldcnt = Integer.parseInt(request.getParameter(cnt + ".SRC_CNT")); if (dac_insert_query.equalsignorecase("")) { // prepared. dac_insert_query = "INSERT INTO "+TABLENAME+" ("; for (int i = 0; i < insert_source_fieldcnt; i++) { String s_fieldname = getencode(request.getparameter(cnt + ".SF_" + i)); if (i == insert_source_fieldcnt - 1) { dac_insert_query += s_fieldname; else { dac_insert_query += s_fieldname + ","; dac_insert_query += ") VALUES ( "; for (int i = 0; i < insert_source_fieldcnt; i++) { if (i == insert_source_fieldcnt - 1) { dac_insert_query += "?"; else { dac_insert_query += "?,"; dac_insert_query += ")"; System.out.println("dac_insert_query="+dac_insert_query); p_insert_stmt = m_conn.preparestatement(dac_insert_query); i)); for (int i = 0; i < insert_source_fieldcnt; i++) { String value = getencode(request.getparameter(cnt + ".SV_" + p_insert_stmt.setstring(i + 1, value); p_insert_stmt.execute(); private void update(httpservletrequest request, HttpServletResponse response, int cnt) throws Exception { int update_source_fieldcnt = Integer.parseInt(request.getParameter(cnt + ".SRC_CNT")); int update_target_fieldcnt = 0; try { update_target_fieldcnt = Integer.parseInt(request.getParameter(cnt + ".TRG_CNT")); catch(exception ex){ if (dac_update_query.equalsignorecase("")) { // prepared. dac_update_query = "UPDATE "+TABLENAME+" set "; for (int i = 0; i < update_source_fieldcnt; i++) { String s_fieldname = getencode(request.getparameter(cnt + ".SF_" + i)); if (i == update_source_fieldcnt - 1) { dac_update_query += s_fieldname +" =? "; else { 250 FORCS Co., LTD

dac_update_query += s_fieldname +" =?, "; dac_update_query += " WHERE "; for (int i = 0; i < update_target_fieldcnt; i++) { String t_fieldname = getencode(request.getparameter(cnt + ".DF_" + i)); if (i == update_target_fieldcnt - 1) { dac_update_query += t_fieldname +" =? "; else { dac_update_query += t_fieldname +" =? AND "; System.out.println("dac_update_query="+dac_update_query); p_update_stmt = m_conn.preparestatement(dac_update_query); i)); j)); int i = 0; for (i = 0; i < update_source_fieldcnt; i++) { String value = getencode(request.getparameter(cnt + ".SV_" + p_update_stmt.setstring(i + 1, value); for (int j = 0; j < update_source_fieldcnt; j++) { String value = getencode(request.getparameter(cnt + ".DV_" + p_update_stmt.setstring(i + 1, value); i++; p_update_stmt.execute(); private void delete(httpservletrequest request, HttpServletResponse response, int cnt) throws Exception { int delete_target_fieldcnt = Integer.parseInt(request.getParameter(cnt + ".TRG_CNT")); if (dac_delete_query.equalsignorecase("")) { // prepared. dac_delete_query = "DELETE FROM "+TABLENAME+" WHERE "; for (int i = 0; i < delete_target_fieldcnt; i++) { String t_fieldname = getencode(request.getparameter(cnt + ".DF_" + i)); if (i == delete_target_fieldcnt - 1) { dac_delete_query += t_fieldname +" =? "; else { dac_delete_query += t_fieldname +" =? AND "; System.out.println("dac_delete_query="+dac_delete_query); p_delete_stmt = m_conn.preparestatement(dac_delete_query); i)); int i = 0; for (i = 0; i < delete_target_fieldcnt; i++) { String value = getencode(request.getparameter(cnt + ".DV_" + p_delete_stmt.setstring(i + 1, value); p_delete_stmt.execute(); FORCS Co., LTD 251

OZ API Developer's Guide (for Java) public void destroy() { super.destroy(); private String getencode(string value) { try { return new String(value.getBytes("8859_1"), "KSC5601"); catch(exception ex){ return value; Step 4 DataModuleSampleServlet.class, DataActionSampleServlet.class. DataModuleSampleServlet.class, DataActionSampleServlet.class. Tomcat 5.0 webapps\root\web-inf\classes sample. DataModuleSampleServlet.class, DataActionSampleServlet.class. Tomcat 5.0 webapps\root\web-inf web.xml.... <!-- JSPC servlet mappings start -->... <servlet> <servlet-name>sample.datamodulesampleservlet</servlet-name> <servlet-class>sample.datamodulesampleservlet</servlet-class> </servlet> <servlet> <servlet-name>sample.dataactionsampleservlet</servlet-name> <servlet-class>sample.dataactionsampleservlet</servlet-class> </servlet>... <servlet-mapping> <servlet-name>sample.datamodulesampleservlet</servlet-name> <url-pattern>/sample.datamodulesampleservlet</url-pattern> </servlet-mapping> 252 FORCS Co., LTD

<servlet-mapping> <servlet-name>sample.dataactionsampleservlet</servlet-name> <url-pattern>/sample.dataactionsampleservlet</url-pattern> </servlet-mapping>... <!-- JSPC servlet mappings end --> Step 5 ODI Servlet API (UDS),. (UDS).. FORCS Co., LTD 253

OZ API Developer's Guide (for Java). [ ]. [].. 254 FORCS Co., LTD

SET_1 [ ], [ ], [ ],,.. INSERT INTO car(#@arg_sf1#, #@ARG_SF2#, #@ARG_SF3#, #@ARG_SF4#, #@ARG_SF5#, #@ARG_SF6#) VALUES('#@ARG_SV1#','#@ARG_SV2#', '#@ARG_SV3#','#@ARG_SV4#', '#@ARG_SV5#', '#@ARG_SV6#'). DELETE FROM car WHERE [#@ARG_DF1#] = '#@ARG_DV1#";. UPDATE car SET [#@ARG_SF1#] = '#@ARG_SV1#', [#@ARG_SF2#] = '#@ARG_SV2#', [#@ARG_SF3#] = '#@ARG_SV3#', [#@ARG_SF4#] = '#@ARG_SV4#', [#@ARG_SF5#] = '#@ARG_SV5#', [#@ARG_SF6#] = '#@ARG_SV6#' WHERE [#@ARG_DF1#] = '#@ARG_DV1#' ODI "JASMIN_SAMPLE4.odi". Step 6 OZF : Servlet API URL DataModule RegisterUserDataModule JavaScript. JavaScript, Document.GlobalFunction OZF OZF. FORCS Co., LTD 255

OZ API Developer's Guide (for Java) OZF. OZF "MyFrameworkURLUDS.ozf". MyFrameworkURLUDS.prototype.GetFrameworkURL = MyFrameworkURLUDS_GetFrameworkURL; MyFrameworkURLUDS.prototype.GetCUDFrameworkURL = MyFrameworkURLUDS_GetCUDFrameworkURL; MyFrameworkURLUDS.prototype.GetFrameworkPostParam = MyFrameworkURLUDS_GetFrameworkPostParam; MyFrameworkURLUDS.prototype.GetCUDFrameworkPostParam = MyFrameworkURLUDS_GetCUDFrameworkPostParam; function MyFrameworkURLUDS(_url, _cud_url, _url_param, _cud_url_param){ this.url = _url; this.cud_url = _cud_url; this.url_param = _url_param; if(this.url_param == null){ this.url_param = ""; this.cud_url_param = _cud_url_param; if(this.cud_url_param == null){ this.cud_url_param = ""; function MyFrameworkURLUDS_GetFrameworkURL(dataset_name){ return this.url; function MyFrameworkURLUDS_GetCUDFrameworkURL(dataset_name){ return this.cud_url; function MyFrameworkURLUDS_GetFrameworkPostParam(dataset_name){ return "default&"+this.url_param; function MyFrameworkURLUDS_GetCUDFrameworkPostParam(dataset_name){ return "default&"+this.cud_url_param; 256 FORCS Co., LTD

GetFrameworkURL GetCUDFrameworkURL. GetFrameworkURL URL. GetCUDFrameworkURL DataAction URL. URL, URL. "JASMIN_SAMPLE4.odi" "MyFrameworkURLUDS.ozf". Board Table Table ODIKey "JASMIN_SAMPLE4", DataSet "SET_1",. Table,, Table "AllowInsert", "AllowDelete", "AllowUpdate" "True". Table OnInitialize. var uds = new MyFrameworkURLUDS("http://127.0.0.1:8088/sample.DataModuleSampleServl et","http://127.0.0.1:8088/sample.dataactionsampleservlet"); FORCS Co., LTD 257

OZ API Developer's Guide (for Java) var datamanager = _GetDataManager(); var datamodule = datamanager.getdatamodule("jasmin_sample4"); datamodule.registeruserdatamodule(uds); Board Button Button OnClick. var result = Table1.CommitQueuedActions(); if(result == "") { Table1.GetDataModule().RefreshAllDataSet(); else { _MessageBox(result); //var myodiobject = _GetDataManager().GetDataModule("odiName").GetUserDataModule(); //Select // myodiobject.url_param = "key1=value1&key2=value2"; //DataAction // myodiobject.cud_url_param = "key1=value1&key2=value2"; //_GetDataManager().GetDataModule("odiName").RefreshAllDataSet(); Step 7.. Delete.. 258 FORCS Co., LTD

,, DataAction. [CommitQueueActions]. Servlet API 2 : Report - Servlet API. Servlet API framworkurl (HTTP URL). odi.odi.framworkurl, odi.framworkurl, connection.framworkurl. : Servlet API,. Step 1 ozsdmapi.jar Servlet API ozsdmapi.jar. Tomcat 5.0 webapps\root\web-inf\lib ozsdmapi.jar. FORCS Co., LTD 259

OZ API Developer's Guide (for Java) Step 2 DataModuleSampleServlet.class. DataModuleSampleServlet.class. Tomcat 5.0 webapps\root\web-inf\classes\sample. DataModuleSampleServlet.class. Tomcat 5.0 webapps\root\web-inf web.xml.... <!-- JSPC servlet mappings start -->... <servlet> <servlet-name>sample.datamodulesampleservlet</servlet-name> <servlet-class>sample.datamodulesampleservlet</servlet-class> </servlet>... <servlet-mapping> <servlet-name>sample.datamodulesampleservlet</servlet-name> <url-pattern>/sample.datamodulesampleservlet</url-pattern> </servlet-mapping>... <!-- JSPC servlet mappings end --> Step 3 JASMIN_SAMPLE2.odi.,. 260 FORCS Co., LTD

"ODI " "JASMIN_SAMPLE2", "" "SET_1". &.. [] " " []. [],,. FORCS Co., LTD 261

OZ API Developer's Guide (for Java) "Sample_ServletAPI.ozr". Step 4. Sample_ServletAPI.htm. <HTML> <BODY> <OBJECT width = "0" height = "0" ID="ZTransferX" CLASSID="CLSID:C7C7225A-9476-47AC-B0B0-FF3B79D55E67" codebase="127.0.0.1:8088/ozrviewer/ztransferx.cab#version=2,0,1,2"> <PARAM NAME="download.Server" VALUE="http://127.0.0.1/ozrviewer"> <PARAM NAME="download.Port" VALUE="8088"> <PARAM NAME="download.Instruction" VALUE="ozrviewer.idf"> <PARAM NAME="install.Base" VALUE="<PROGRAMS>/Forcs"> <PARAM NAME="install.Namespace" VALUE="Sample_ServletAPI"> </OBJECT> <OBJECT id = "ozrviewer" CLASSID="CLSID:0DEF32F8-170F-46f8-B1FF- 4BF7443F5F25" width="100%" height="100%"> <param name="connection.servlet" value="http://127.0.0.1:8088/ozservlet35/server"> <param name="connection.reportname" value="sample_servletapi.ozr"> <param name="odi.odinames" value="jasmin_sample2"> <param name="odi.jasmin_sample2.frameworkurl" value="http://127.0.0.1:8088/sample.datamodulesampleservlet"> <param name="odi.jasmin_sample2.fetchtype" value="batch"> <param name="viewer.isframe" value="false"> <param name="viewer.namespace" value="sample_servletapi\ozviewer"> </OBJECT> </body> </HTML> : Servlet API 262 FORCS Co., LTD

odi.odi.framworkurl odi.framworkurl connection.framworkurl URL... FORCS Co., LTD 263