untitled

Similar documents
untitled

untitled

untitled

untitled

untitled

untitled

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

untitled

자바-11장N'1-502

14-Servlet

untitled

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

12-file.key

PowerPoint 프레젠테이션

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

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

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

JMF2_심빈구.PDF

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 03-TCP Programming.ppt

歯JavaExceptionHandling.PDF

PowerPoint 프레젠테이션

자바 프로그래밍

untitled

FileMaker ODBC and JDBC Guide

<4D F736F F F696E74202D20C1A63235C0E520B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

Interstage5 SOAP서비스 설정 가이드

JavaGeneralProgramming.PDF

04장

05-class.key

untitled

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

Chap12

untitled

mytalk

13-Java Network Programming

FileMaker ODBC and JDBC Guide

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 (

교육자료

슬라이드 1

untitled

Cluster management software

PowerPoint 프레젠테이션

PowerPoint Presentation

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

비긴쿡-자바 00앞부속

J2EE Concepts

thesis

PowerPoint Presentation

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

untitled

MasoJava4_Dongbin.PDF

NoSQL

Network seminar.key

PowerPoint Presentation

JMF3_심빈구.PDF

09-interface.key

untitled

Java

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

Microsoft PowerPoint - 18-DataSource.ppt

Network Programming

untitled

untitled

FileMaker 15 ODBC 및 JDBC 설명서

1

JAVA PROGRAMMING 실습 09. 예외처리

untitled

untitled

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

쉽게 풀어쓴 C 프로그래밊

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

Java ...

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

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

03-JAVA Syntax(2).PDF

PowerPoint 프레젠테이션

1217 WebTrafMon II

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

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

chapter1,2.doc

FileMaker ODBC 및 JDBC 가이드

ch09

10.ppt

untitled

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

untitled

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

Chap7.PDF

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

03장

01-OOPConcepts(2).PDF

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

5장.key

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에

Transcription:

API... 3 Class Cache... 5 Class ConnectionPool... 10 Class DataBind... 15 Class Log... 19 Class Module... 23 Class Monitor... 34 Class Repository... 38 Class Service... 84 Class Viewer... 87 API... 95 Class Program... 97 Class Publisher... 103 Class Scheduler... 107 API... 136 OZLauncherDll... 137 FORCS Co., LTD 1

OZ API Developer's Guide User Data Store... 141 UDS... 142 UDS... 143 UDS... 145 User Security Logic... 157 USL... 158 USL... 160 USL... 162... 183... 184... 184... 186 C... 194 SchedulerCom... 213 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 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 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 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 Cache cache = null; 8 FORCS Co., LTD

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 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 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 : ConnectionSample.java package sample; 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) poolinfo.setserveraddress("127.0.0.1");// IP poolinfo.setportno(1433); // poolinfo.setdbname("db"); // poolinfo.setuser("admin"); // poolinfo.setpassword("admin"); // poolinfo.setmaxconns(20); // poolinfo.setinitconns(1); // FORCS Co., LTD 13

OZ API Developer's Guide poolinfo.settimeout(5); conpool.addpool(poolinfo); // // (getpoolinfo) poolinfo = conpool.getpoolinfo("forcs"); poolinfo._print(system.out); // (removepool) String conpoolname = "forcs"; // conpool.removepool(conpoolname); // ConnectionPoolInfo (getpoolinfolist) ConnectionPoolInfo[] poolinfolist = conpool.getpoolinfolist(); for (int i = 0; i < poolinfolist.length; i++) { poolinfolist[i]._print(system.out); // 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 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); System.out.println(name + "=" + p.getproperty(name)); FORCS Co., LTD 17

OZ API Developer's Guide 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 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 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 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 saveozd(string filename, String item, String category, String[] urls) void saveozu(string filename, String item, String category, String[] urls) Constructor Detail FORCS Co., LTD 23

OZ API Developer's Guide //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 Argument public InputStream getozd(string item, String category, String[] urls) throws OZCPException SDM OZD. OZD urls. : API DM_TYPE="Momory", FetchType="Batch".. item ( OZR ) category 24 FORCS Co., LTD

urls OZD URL getozd protected 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 getozu public InputStream getozu(string item, String category, String[] urls) throws OZCPException FORCS Co., LTD 25

OZ API Developer's Guide 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 26 FORCS Co., LTD

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 saveozd public void saveozd(string filename, String item, String category, String[] urls) throws OZCPException OZD. : API DM_TYPE="Momory", FetchType="Batch".. Argument filename item category Urls OZD (.ozr) (.ozr) OZD URL FORCS Co., LTD 27

OZ API Developer's Guide 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) { 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 { 28 FORCS Co., LTD

1"); 2"); //* // Daemon module = new Module(IP, PORT, ID, PWD, false, false); /*/ // Servlet module = new Module(URL, ID, PWD, false, false); /**/ //module.addodiparameter(" 100 ", "rowcount", "40000"); // 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 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(); FORCS Co., LTD 29

OZ API Developer's Guide 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); 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(); 30 FORCS Co., LTD

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 { 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"; FORCS Co., LTD 31

OZ API Developer's Guide //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); FileOutputStream out = new FileOutputStream(filename); 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; 32 FORCS Co., LTD

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(); // 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 33

OZ API Developer's Guide 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; 34 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 35

OZ API Developer's Guide 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 /*/ 36 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 37

OZ API Developer's Guide 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) 38 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 39

OZ API Developer's Guide // 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) 40 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 41

OZ API Developer's Guide 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 42 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 43

OZ API Developer's Guide // 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 44 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 45

OZ API Developer's Guide 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 46 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 47

OZ API Developer's Guide // 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 48 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 FORCS Co., LTD 49

OZ API Developer's Guide // 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 deleteitem public void deleteitem(int itemid) throws OZCPException. Argument itemid ID 50 FORCS Co., LTD

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 input ID updatedirectitem public void updatedirectitem(string itemname, int itemtype, String categoryname, InputStream input) throws OZCPException FORCS Co., LTD 51

OZ API Developer's Guide 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 // ItemList getitemlist public OZRepositoryItem[] getitemlist() throws OZCPException. 52 FORCS Co., LTD

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. Argument cid gid perm categoryfullpath ID ID FORCS Co., LTD 53

OZ API Developer's Guide 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. Argument categorypath deletecategory public void deletecategory(int cid) throws OZCPException ID. 54 FORCS Co., LTD

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 getcategorylistincategory public OZRepositoryCategory[] getcategorylistincategory(int cid) throws OZCPException public OZRepositoryCategory[] getcategorylistincategory(int cid, int uid, byte perm) throws OZCPException FORCS Co., LTD 55

OZ API Developer's Guide. 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 // CheckInOut checkoutitem public void checkoutitem(int itemid, int uid, String checkoutfolder) throws OZCPException ID. 56 FORCS Co., LTD

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 public InputStream getspecifiedversionitem(int itemid, int itemversion) throws OZCPException ID. Argument itemid itemversion ID FORCS Co., LTD 57

OZ API Developer's Guide 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 public String getusername(). getuserid public int getuserid() ID. 58 FORCS Co., LTD

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(). getisloggedin public boolean getisloggedin(). getsessionid public int getsessionid() FORCS Co., LTD 59

OZ API Developer's Guide 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(). getdirectpermission public byte getdirectpermission(). 60 FORCS Co., LTD

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(). getitemid public int getitemid() ID. getitemtype public int getitemtype() FORCS Co., LTD 61

OZ API Developer's Guide. 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(). getischeckedout public boolean getischeckedout(). getdirectpermission public byte getdirectpermission() 62 FORCS Co., LTD

. 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. getparentcategoryid public int getparentcategoryid() ID. FORCS Co., LTD 63

OZ API Developer's Guide 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[] ). OZRepositoryHistory(oz.framework.repository.OZRepositoryHistory). - gethistoryitempath public String gethistoryitempath() 64 FORCS Co., LTD

. 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; import oz.dm.dmconst; import java.io.*; import java.net.*; import org.apache.log4j.*; import java.io.ioexception; import java.util.*; FORCS Co., LTD 65

OZ API Developer's Guide 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. 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"); 66 FORCS Co., LTD

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. 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"; FORCS Co., LTD 67

OZ API Developer's Guide 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); 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; 68 FORCS Co., LTD

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) "); categoryinfolist = repository.getcategorylistincategory(0); showcategoryinfolist(categoryinfolist); // id //. System.out.println("Repository.getCategoryListInCategory( int categoryid, int userid, byte perm)"); categoryinfolist = repository.getcategorylistincategory(cid, uid, FORCS Co., LTD 69

OZ API Developer's Guide 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) return; for(int i=0; i < categorylist.length; i++) { showcategory(categorylist[i]); private static void showcategory(ozrepositorycategory c) { System.out.println("CategoryId : " + c.getcategoryid()); 70 FORCS Co., LTD

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); //. System.out.println( "Repository.getItemListInCategory(String categoryname)"); iteminfolist = repository.getitemlistincategory(categoryname); showiteminfolist(iteminfolist); // userid //. FORCS Co., LTD 71

OZ API Developer's Guide 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); showiteminfolist(iteminfolist); /**************************************************************************** //. System.out.println( "Repository.findItemByItemIndex(String[] itemindex, int[] oper)"); String[] itemindex = {"index test 1", "index test 2", "index test 3"; 72 FORCS Co., LTD

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)"); 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)); FORCS Co., LTD 73

OZ API Developer's Guide 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)"); 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); 74 FORCS Co., LTD

//. 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); 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[" + FORCS Co., LTD 75

OZ API Developer's Guide 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. 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)); 76 FORCS Co., LTD

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()); 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 : "); FORCS Co., LTD 77

OZ API Developer's Guide 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 : " + (repository.getgroupinfo(gid)).getparentgroupid()); //. System.out.println("Repository.updateGroupName(int groupid, String groupname)"); String newgroupname = "( "; 78 FORCS Co., LTD

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; //. System.out.println("Repository.getUserList()"); userinfolist = repository.getuserlist(); showuserinfolist(userinfolist); //. System.out.println("Repository.getUserListInGroup(int gid)"); FORCS Co., LTD 79

OZ API Developer's Guide 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)"); 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 : " + 80 FORCS Co., LTD

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); // username login disable. System.out.println("Repository.disableUserLogin(String username)"); String username = repository.getusernamebyid(uid); repository.disableuserlogin("'" + username + "'"); FORCS Co., LTD 81

OZ API Developer's Guide // 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); userdesctest(uid); useridtest(uid); userlisttest(uid); userpwdtest(uid); //. 82 FORCS Co., LTD

System.out.println("Repository.deleteUser(int uid)"); repository.deleteuser(uid); FORCS Co., LTD 83

OZ API Developer's Guide 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; 84 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 85

OZ API Developer's Guide 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) { 86 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 87

OZ API Developer's Guide //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 88 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 FORCS Co., LTD 89

OZ API Developer's Guide getdatamodules 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). 90 FORCS Co., LTD

GetSetName public String GetSetName(). 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) FORCS Co., LTD 91

OZ API Developer's Guide PrintStream. Argument out PrintStream 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 92 FORCS Co., LTD

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 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)); FORCS Co., LTD 93

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

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

OZ API Developer's Guide API. API. Program Publisher Scheduler... API. ozsfw35.jar log4.jar Scheduler server. Server Log. (API classpath "log4.jar" ) 96 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 97

OZ API Developer's Guide 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 : ( ) 98 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 99

OZ API Developer's Guide 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 100 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[] = program.downloadfile(serverinfo, foldername+"/"+downfilename); FORCS Co., LTD 101

OZ API Developer's Guide // (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(); 102 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 103

OZ API Developer's Guide 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 : ( ) 104 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.*/ // (createfolder) FORCS Co., LTD 105

OZ API Developer's Guide 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) { 106 FORCS Co., LTD

Constructor Summary scheduler(string ip, int port) Method Summary void createtask(serverinfo s, SortProperties configmap, SortProperties exportmap) SortProperties getconfiguration(serverinfo s) Vector gettask(serverinfo s) Vector gettaskresult(serverinfo s, String from, String to, String taskid) void modifyconfiguration(serverinfo s, SortProperties configmap, SortProperties exportmap) void removetask(serverinfo s, String task) void stop(serverinfo s, boolean waittask) boolean taskpause(serverinfo s, String task) boolean taskresume(serverinfo s, String task) boolean makepdf(serverinfo s, SortProperties configmap, SortProperties exportmap) public boolean export(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException Constructor Detail ppublic scheduler(string ip, int port) Argument ip IP ex) String ip = "127.0.0.1"; FORCS Co., LTD 107

OZ API Developer's Guide port (:9521) ex) int port = 9521; Method Detail createtask public void createtask(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException. Argument s configmap exportmap key "Option". key "Option". getconfiguration public SortProperties getconfiguration(serverinfo s) throws SchedulerException. Argument s gettask public Vector gettask(serverinfo s) throws SchedulerException. Argument s gettaskresult public Vector gettaskresult(serverinfo s, String from, String to, String taskid) throws SchedulerException. 108 FORCS Co., LTD

Argument s from to taskid modifyconfiguration public void modifyconfiguration(serverinfo s, SortProperties configmap) throws SchedulerException. Argument s configmap key "Option". removetask public void removetask(serverinfo s, String taskid) throws SchedulerException. Argument s taskid stop public void stop(serverinfo s, boolean waittaskid) throws SchedulerException. Argument s waittaskid taskpause public boolean taskpause(serverinfo s, String taskid) throws SchedulerException. Argument s FORCS Co., LTD 109

OZ API Developer's Guide taskid taskresume public boolean taskresume(serverinfo s, String taskid) throws SchedulerException. Argument s taskid 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 ". export public boolean export(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException 110 FORCS Co., LTD

. : "ViewType=None". :.pdf,.ozd,.html,.jpg,.xls,.doc,.svg,.txt,.ppt,.tif, csv. s Argument configmap exportmap key "Option". key "Option". : export API COM ASP "Appendix 1. SchedulerCOM ". Class ServerInfo(oz.scheduler.ServerInfo) Program class " class". SortProperties (oz.util.sortproperties) Cache class " class". Option - "ViewType" "None", API, OZD. -,. FORCS Co., LTD 111

OZ API Developer's Guide applet.mode viewer.mode applet.useprogressbar viewer.useprogressbar applet.allowmultiframe viewer.allowmultiframe export.mode export.confirmsave information.debug applet.showerrormessage viewer.showerrormessage export export false 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_na me "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") 112 FORCS Co., LTD

- Key Value task_type "viewertag",. "SchedulerViewerTagSample.java". ex) setproperty("task_type ", "viewertag") - Key Value external_progra m_check external_progra m_command "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 _check 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") FORCS Co., LTD 113

OZ API Developer's Guide mail_recipient_b cc mail_subject mail_text_messa ge mail_html_comm ent html_mail_conte nt mail_attach_list "check" "null" "check" "null" ex) setproperty("mail_recipient_bcc", "bbb@forcs.com") 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") 114 FORCS Co., LTD

parameter_value _1... parameter_value _n (n : ) ex) setproperty("parameter_value_1", " 10") : ODI,. "[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_n ame_1... odi_parameter_n ame_n odi_parameter_v alue_1... odi_parameter_v alue_n (n : ) ex) setproperty("odi_parameter_name_1", "id") (n : ) ex) setproperty("odi_parameter_value_1", " 10") : ODI, ODI ODI. FORCS Co., LTD 115

OZ API Developer's Guide - Key Value launch_type "once" "immediately" "periodically" once : immediately : periodically : ex) setproperty("launch_type", "once") launch_ type = once Key Value 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_exec ution_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") 116 FORCS Co., LTD

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_w eeks weekly_monday_ check weekly_tuesday_ check weekly_wednesd ay_check weekly_thursday _check weekly_friday_ch eck weekly_saturday _check weekly_sunday_ check "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" "check" "null" ex) setproperty("weekly_every_weeks", "2") 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_ months monthly_type "specific_day", "day_of_week", "user_defined" ( ) ex) setproperty("monthly_every_months", "2") ex) setproperty("monthly_type", "specific_day") FORCS Co., LTD 117

OZ API Developer's Guide monthly_days monthly_which_ week monthly_which_ week_day monthly_user_de fined_days "T1" "T2" "T3"" T4" "T5" "sunday" "monday" "tuesday" "wednesday" "thursday" "friday" "saturday" ex) setproperty("monthly_days", "2") T1 : T2 : T3 : T4 : T5 : ex) setproperty("monthly_which_week", "T2") 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") 118 FORCS Co., LTD

periodically_ execution_time_ type = repeat Key Value repeat_every_ho urs repeat_every_mi nutes repeat_start_hou r repeat_start_min ute repeat_end_hour repeat_end_minu te ex) setproperty("repeat_every_hours", "01") ex) setproperty("repeat_every_minutes", "04") ex) setproperty("repeat_start_hour", "02") ex) setproperty("repeat_start_minute", "05") 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_tim e (:) (,) ex) setproperty("user_defined_time", "01:30,13:30") CSV Key Value csv.filename csv.pagetitle csv.pageline "page" CSV ex) setproperty("csv.filename","test.csv") ex) setproperty("csv.pagetitle", "<<Page>>") ex) setproperty("csv.pageline ", "7") FORCS Co., LTD 119

OZ API Developer's Guide csv.pagestyle csv.separator csv.removerange csv.exceptfirstpa ge csv.savetointeger "none" "# <page>" "# <page> ---" "--- #<page>" "<page> #" "Tab" "Space" "Comma" "true" "false" "true" "false" (:none - ) ex) setproperty("csv.pagestyle", "none") CSV ex) setproperty("csv.separator", "Tab") (", " ) 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 "columnpersheet" "paperpersheet" ex) setproperty("excel.numberformat ", "#,##0.00") ex) setproperty("excel.savefont", "Arial, Courier") columnpersheet : Sheet () paperpersheet : Sheet ex) setproperty("excel.matchmode", "columnpersheet") 120 FORCS Co., LTD

Excel.matchsubm ode excel.removeran ge excel.removeopti on "RowFirst" "ColumnFirst" "FirstPageOnly" "FirstPageExcept" "AllPage" (:RowFirst) ex) setproperty("excel.matchsubmode", "rowfirst") (", " ) ex) setproperty("excel.removerange", "1,3") 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") FORCS Co., LTD 121

OZ API Developer's Guide html.offsetx x (:) ex) setproperty("html.offsetx","1") html.offsety y (:) ex) setproperty("html.offsety","1") 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") 122 FORCS Co., LTD

pdf.saverange pdf.title pdf.subject pdf.creator pdf.author pdf.keyword pdf.userpasswor d pdf.masterpassw ord (", " ) ex) setproperty("pdf.saverange ", "1.3") PDF ex) setproperty("pdf.title", "Report") PDF ex) setproperty("pdf.title", "Report") ex) setproperty("pdf.creator", "Forcs") 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") FORCS Co., LTD 123

OZ API Developer's Guide Text Key Value text.filename Text ex) setproperty("text.filename","test.txt") text.pagetitle "page" ex) setproperty("csv.pagetitle", "<<Page>>") text.pageline ex) setproperty("text.pageline ", "7") 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 ex) setproperty("tiff.filename", "test.tif") 124 FORCS Co., LTD

tiff.encode "G3" "G4" 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") 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 ex) p.setproperty("mailfrom", "mail@forcs.com"); FORCS Co., LTD 125

OZ API Developer's Guide TempRepositoryF ilepath ex) p.setproperty("temprepositoryfilepath", "%SCH_HOME%/Te mp Repository"); RepositoryFileRo otpath ex) p.setproperty("repositoryfilerootpath", "%SCH_HOME%/Repository"); ExternalProgram FilePath ex) p.setproperty("externalprogramfilepath", "%SCH_HOME%/External"); ErrorNotifyToSen der "true" "false" true : false : ex) p.setproperty("errornotifytosender", "false"); 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",// 126 FORCS Co., LTD

// {"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",// // {"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" FORCS Co., LTD 127

OZ API Developer's Guide ; // 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", // {"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.saverange ", "1.3", {"pdf.title ", "Report", {"pdf.subject ", "OZ", {"pdf.creator ", "hong", //pdf //pdf //pdf //pdf //pdf 128 FORCS Co., LTD

{"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 // 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" // FORCS Co., LTD 129

OZ API Developer's Guide ; 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"); // 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); 130 FORCS Co., LTD

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.) 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]); FORCS Co., LTD 131

OZ API Developer's Guide 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(); 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.errormsg); System.out.println(""); 132 FORCS Co., LTD

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; 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"); FORCS Co., LTD 133

OZ API Developer's Guide 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"); 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"); 134 FORCS Co., LTD

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"); 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); FORCS Co., LTD 135

OZ API Developer's Guide API OZLauncherDll 136 FORCS Co., LTD

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) Applet ActiveX. Argument strpath Applet ActiveX SetClassNameForJava void_stdcall SetClassNameForJava(LPCTSTR strclassname) Applet Main Class.( Applet ) Argument strclassname Main Class FORCS Co., LTD 137

OZ API Developer's Guide 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. 138 FORCS Co., LTD

Argument str_param n_type. "n". 1 2. 1 Applet, 2 ActiveX. Example 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=ozcar.xml\n connection.compressedform=true\n", 1); 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 : FORCS Co., LTD 139

OZ API Developer's Guide Release() void stdcall Release().. ActiveX 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=ozcar.xml\n connection.compressedform=true",1); result = GetResult(); Release(); Example Applet SetPath("./"); SetClassNameForJava("oz.application.OZIEApplication"); SetPackageNameForJava("ozapp.zip"); SetMSViewerTypeForJava(2); SetCommand("/locale ko/kr /mode alone /slp true /launchstring"); 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=ozcar.xml\n connection.compressedform=true\n", 1); result = GetResult(); Release(); 140 FORCS Co., LTD

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

OZ API Developer's Guide 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.. 142 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 143

OZ API Developer's Guide 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(). 144 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 145

OZ API Developer's Guide 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{ 146 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_LGeds(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 147

OZ API Developer's Guide 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(); 148 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 149

OZ API Developer's Guide 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); ////////////////////////////////////////////////////////////////////////////// 150 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 151

OZ API Developer's Guide 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; 152 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 153

OZ API Developer's Guide 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{ 154 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 155

OZ API Developer's Guide 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; 156 FORCS Co., LTD

User Security Logic UDS UDS UDS FORCS Co., LTD 157

OZ API Developer's Guide 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 158 FORCS Co., LTD

USL Web WAS Session Cookie ( ), Network I/O Stream, PKI. Session ( Session USL ) UseUserSecurityLogic=true OZ Server Server Side Network I/O Module WAS 3. 4-1 USL Server Module 4-2 USL Client 2. USL USL Client Module 4-3 Exception 1. Connection Request Client Side Network I/O Module <param name="connection.usingusl" value="true"> OZ Viewer <param name="connection.args1" value="session_name=oz_session"> FORCS Co., LTD 159

OZ API Developer's Guide USL. - USL : OZ_HOME/lib/ozsfw35.jar - USL : OZ_HOME/conf/uslmngr.properties - ozsfw35.jar CLASSPATH. - uslmngr.properties. <<uslmngr.properties>> # # use user security logic apply # UseUserSecurityLogicVer30=true # # default USL(Server&Client) class name (with package name) # OZDefault_SERVER= ozusl.defozuslserver OZDefault_CLIENT=DefOZUSLClient # # group level USL setting # %GROUP_NAME%_SERVER=%USLServer class name with package% # %GROUP_NAME%_CLIENT=%USLClient class name with package% # categoryname1_server=ozusl.category1ozserver categoryname1_client=category1ozclient category2_server=ozusl.category2ozserver category2_client=category2ozclient uslmngr.properties UseUserSecurityLogicVer30=true. 160 FORCS Co., LTD

. USL USL (DLL ). OZDefault_SERVER=USL OZDefault_CLIENT=USL DLL. PKI DLL.. Report_group_SERVER=USL Report_group_CLIENT=USL DLL :. OZ Viewer Tag <param name="connection.usingusl" value="true">. UseUserSecurityLogicVer30=true. HTML <<.html>> <html> <body> <object id="ozviewer" width="800" height="600" classid="clsid:64da633f-e73b-4344-83bf- 48483346CD53" <param name="viewer.namespace" value="activex30ozviewer"> <param name="connection.servlet" value="http:// 127.0.0.1:9080/oz/server"> <param name="connection.reportname" value="group1/test.xml"> <param name="viewer.configmode" value="html"> <param name="connection.usingusl" value="true"> <param name="connection.pcount" value="3"> <param name="connection.args1" value="session_name=oz_session"> <param name="connection.args2" value="fromdate=2000-12-28"> <param name="connection.args3" value="todate=2000-12-31"> </object> </body> </html> FORCS Co., LTD 161

OZ API Developer's Guide 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 162 FORCS Co., LTD

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 FORCS Co., LTD 163

OZ API Developer's Guide. USL CJDataOutputStream CJDataOutputStream. write flush CJDataOutputStream. flush. USL USL WAS Valid. OZ_HOME/usl/sample/DefOZUSLServer. java, OZ USL DLL. DefOZUSLClient DLL. Server Side USL Module DefOZUSLServer OZUSLServer. DefOZUSLServer Client, WAS OZ Servlet.. createsecureinputstream getsecureoutput Stream. HttpSession,, DataOutputStream write(int b), close(), flush() DataOutputStream Byte ArrayOutputStream flush. <<DefOZUSLServer.java>> package ozusl; import java.io.*; import oz.cp.ozuslserver; import javax.servlet.http.httpsession; 164 FORCS Co., LTD

import oz.cp.message.ozcmexception; public class DefOZUSLServer extends OZUSLServer { String share_key_tag, share_key_value; public DefOZUSLServer() { class DefOZServerOutputStream extends OutputStream { ByteArrayOutputStream bout; DataOutputStream out_org=null; int b_length=0; public DefOZServerOutputStream(HttpSession _http_session, String _report_name, DataOutputStream _out_org) throws OzcmException { 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 { byte[] b_org = bout.tobytearray(); System.out.println("bout.reset();"); bout.reset(); out_org.writeint(b_org.length); out_org.write(b_org, 0, b_org.length); out_org.flush(); FORCS Co., LTD 165

OZ API Developer's Guide public InputStream createsecureinputstream(datainputstream org_in) { try { share_key_tag = org_in.readutf(); catch(exception e) { share_key_tag = null; System.out.println("\nDefOZUSLServer: can't get share_key! check USL configuration for " + report_name); e.printstacktrace(); return null; public OutputStream createsecureoutputstream(dataoutputstream out_org) throws OzcmException { return new DefOZServerOutputStream(http_session, report_name, out_org); Servlet WAS /oz (Servlet). WEB- 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. 166 FORCS Co., LTD

Cookie. Client Side USL Module DefOZUSLClient OZUSLClient., USL connection.usingusl true USL USL DefOZUSLServer. createsecureinputstream getsecureoutput Stream. createsecureoutputstream "session_name" DataOutputStream. createsecureinputstream InputStream. << Tag>> <html> <body> <<object id="ozviewer" width="800" height="600" classid="clsid:64da633f-e73b- 4344-83BF-48483346CD53" <param name="viewer.namespace" value="activex30\ozviewer"> <param name="connection.servlet" value="http:// 127.0.0.1:9080/oz/server"> <param name="connection.reportname" value="group1/test.xml"> <param name="viewer.configmode" value="html"> <param name="connection.usingusl" value="true"> <param name="connection.pcount" value="3"> <param name="connection.args1" value="session_name=oz_session"> <param name="connection.args2" value="fromdate=2000-12-28"> <param name="connection.args3" value="todate=2000-12-31"> </object> </body> </html> <<USLClient.cpp>> // USLClient.cpp: implementation of the CUSLClient class. // ////////////////////////////////////////////////////////////////////// #include <stdafx.h> #include <ozuslclient/ozuslclient.h> #include <ozuslclient/uslclient.h> #include <ozuslclient/jusldatainputstream.h> #include <ozuslclient/jusldataoutputstream.h> #ifdef _DEBUG #undef THIS_FILE FORCS Co., LTD 167

OZ API Developer's Guide static char THIS_FILE[]= FILE ; #define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CUSLClient::CUSLClient() { m_str_ip = _T(""); m_str_url = _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(); return pout; <<JUSLDataInputStream.cpp>> // JUSLDataInputStream.cpp: implementation of the CJUSLDataInputStream class. 168 FORCS Co., LTD

////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "JUSLDataInputStream.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(); 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.tobytearray(); in->close(); delete buf; catch(czexception *eof){ throw eof; m_pin = new CJDataInputStream (new CJByteArrayInputStream(arrayBuffer->getBuffer(), 0, arraybuffer->length(), TRUE), TRUE); in = m_pin; delete arraybuffer; catch(czexception * ex){ throw ex; FORCS Co., LTD 169

OZ API Developer's Guide CJUSLDataInputStream::~CJUSLDataInputStream() { 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(); 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(); 170 FORCS Co., LTD

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); 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" FORCS Co., LTD 171

OZ API Developer's Guide #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; CJUSLDataOutputStream::~CJUSLDataOutputStream() { void CJUSLDataOutputStream::WriteSessionKeyToServer() { 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; catch(czexception * e){ throw e; 172 FORCS Co., LTD

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 173

OZ API Developer's Guide 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{ 174 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 175

OZ API Developer's Guide ////////////////////////////////////////////////////////////////////// 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" 176 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 177

OZ API Developer's Guide 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(); 178 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 179

OZ API Developer's Guide 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() 180 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 181

OZ API Developer's Guide PKI Import USL. 182 FORCS Co., LTD