untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1 API... 5 Class Cache... 7 Class ConnectionPool Class DataBind Class Log Class Module Class Monitor Class Repository Class Service Class Viewer API Class Program Class Publisher Class Scheduler Class TaskHolidayInfo Class TaskHolidayGroupInfo API OZLauncherDll FORCS Co., LTD 1

2 OZ API Developer's Guide (for Java) RDB Store DataAction RDB Store DataAction RDB Store DataAction User Data Store UDS UDS UDS User Security Logic USL USL USL User Defined Log UDL UDL UDL Interface Repository Class RepositoryEX FORCS Co., LTD

3 C SchedulerCom Servlet API FORCS Co., LTD 3

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

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

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

7 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) url ip port id Servlet URL ex) String url = " Daemon IP ex) String ip = " "; Daemon ex) int port = 8003; ex) String id = "admin"; FORCS Co., LTD 7

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

9 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 9

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

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

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

13 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". pool ConnectionPool ConnectionPoolInfo removepool public void removepool(string pool) throws OZCPException ConnectionPool. pool ConnectionPool getpoolinfolist public ConnectionPoolInfo[] getpoolinfolist() throws OZCPException ConnectionPool ConnectionPoolInfo. getpoolstatuslist public ConnectionPoolStatus[] getpoolstatuslist() throws OZCPException FORCS Co., LTD 13

14 OZ API Developer's Guide (for Java) ConnectionPool. getpoolinfo public ConnectionPoolInfo getpoolinfo(string alias) throws OZCPException ConnectionPool ConnectionPoolInfo. 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 OK ConnectionPool DRIVER_ERROR ConnectionPool JDBC CONNECTION_ERROR ConnectionPool DBMS public final static int DRIVER_ERROR = -1; public final static int CONNECTION_ERROR = -2; 14 FORCS Co., LTD

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

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

17 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) url ip port id Servlet URL ex) String url = " Daemon IP ex) String ip = " "; Daemon ex) int port = 8003; ex) String id = "admin"; FORCS Co., LTD 17

18 OZ API Developer's Guide (for Java) pw bautologin useusl ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail setdatabindconfigration public void setdatabindconfigration(sortproperties config) throws OZCPException DataBind, "databind.properties". 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. :,. 18 FORCS Co., LTD

19 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 = " "; // 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++) { FORCS Co., LTD 19

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

21 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) url ip port Servlet URL ex) String url = " Daemon IP ex) String ip = " "; Daemon ex) int port = 8003; FORCS Co., LTD 21

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

23 setpriority public void setpriority(string p) throws OZCPException.(INFO, DEBUG, ERROR) 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 = " "; // IP int PORT = 8003; // TCP // Servlet String URL = " //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"; //. FORCS Co., LTD 23

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

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

26 OZ API Developer's Guide (for Java) throws OZCPException public IReportInfo addreport(string itemname, String categoryname, String displayname) throws OZCPException public InputStream getozd() throws OZCPException public void saveozd(string filename) throws OZCPException Constructor Detail //Daemon - TCP Server public Module(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) //Servlet - HTTP Server public Module(String url, String id, String pw, boolean bautologin, boolean useusl) url ip port id pw bautologin useusl Servlet URL ex) String url = " Daemon IP ex) String ip = " "; 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 26 FORCS Co., LTD

27 public InputStream getozd(string item, String category, String[] urls) throws OZCPException public final InputStream getozd(string item, String category, Hashtable formparam, Hashtable odiparam, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) throws Exception public final InputStream getozd(string item, String category, String serverdmtype, Hashtable formparam, Hashtable odiparam, Hashtable odipath, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) OZD, OZD urls., OZD, OZD.,. : API serverdmtype serverdmtype DM_TYPE="Memory", FetchType="Batch".. item ( OZR ) category urls serverdmtype formparam odiparam OZD URL Memory File ( :Memory) : Hashtable (String), (String ). ODI : ODI Hashtable ODI(String), (Hashtable), Hashtable (String), (String). FORCS Co., LTD 27

28 OZ API Developer's Guide (for Java) odipath memoallowed password id pwd request ODI OZD OZD HttpServletRequest getozdwithsdm public final InputStream getozdwithsdm(string item, String category, Hashtable sdm, Hashtable formparam, boolean memoallowed, String password, String id, String pwd, HttpServletRequest request) throws Exception SDM OZD.,. Servlet API SDM "SDM gzip Base64 Encode Encode URI". SDM "Base64 Decode ungzip SDM ". getozdwithsdm doget dopost dopost getozdwithsdm. item ( OZR ) category sdm formparam memoallowed password id pwd request OZD SDM : Hashtable (String), (String ). OZD OZD HttpServletRequest getozu 28 FORCS Co., LTD

29 public InputStream getozu(string item, String category, String[] urls) throws OZCPException SDM OZU. : API DM_TYPE="Momory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". item category urls ( OZA ) OZU URL addodiparameter public void addodiparameter(string odiname, String key, String value) SDM ODI ODI. ODI ODI. odiname ODI key value ODI ODI addodiparameter public void addodiparameter(string odiname, String item, String category, Hashtable paramhash) throws IllegalException SDM ODI ODI. ODI ODI. ODI SDM SDM. odiname item category paramhash ODI ODI ODI Key, Value Hashtable FORCS Co., LTD 29

30 OZ API Developer's Guide (for Java) : OZU paramhash 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.. key value addapplicationparameter public void addapplicationparameter(string key, String value) SDM. ODI ODI ODI. key ODI value ODI registodipath public void registodipath (String odiname, String path) throws IllegalException OZD ODI. odiname path ODI ODI saveozd public void saveozd(string filename, String item, String category, String[] urls) throws OZCPException 30 FORCS Co., LTD

31 OZD. : API DM_TYPE="Momory", FetchType="Batch".. filename item category Urls OZD (.ozr) (.ozr) OZD URL saveozu public void saveozu(string filename, String item, String category, String[] urls) throws OZCPException OZU. : API DM_TYPE="Momory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". filename item category Urls OZU (.oza) (.oza) OZU URL addreport public IReportInfo addreport(string itemname, String categoryname) throws OZCPException OZD. itemname categoryname public IReportInfo addreport(string itemname, String categoryname, String displayname) throws OZCPException FORCS Co., LTD 31

32 OZ API Developer's Guide (for Java) OZD. itemname categoryname displayname getozd public InputStream getozd() throws OZCPException OZD. saveozd public void saveozd(string filename) throws OZCPException OZD OZD. filename Interface IReportInfo(oz.framework.api.IReportInfo) OZD. getitemname public String getitemname(). getcategoryname public String getcategoryname(). addurl public void addurl(string[] urls) URL. urls URL 32 FORCS Co., LTD

33 public void addurl(string url) URL. url URL addparameter public void addparameter(string key, String value). key value addodiparameter public void addodiparameter(string odiname, String key, String value) ODI. odiname key value ODI ODI ODI 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 = " "; // IP int PORT = 8003; // TCP /*/ // Servlet FORCS Co., LTD 33

34 OZ API Developer's Guide (for Java) 1"); 2"); String URL = " /**/ // User Info. String ID = "admin"; //default String PWD = "admin"; //default Module module = null; InputStream stream = null; try { //* // Daemon module = new Module(IP, PORT, ID, PWD, false, false); /*/ // Servlet module = new Module(URL, ID, PWD, false, false); /**/ //module.addodiparameter(" 100 ", "rowcount", "40000"); //replace ODI //module.registodipath(" 100 ", "// 100 //.odi"); // module.addparameter("server", " "); // 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 = { " " "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 ; 34 FORCS Co., LTD

35 module.setpassword("1234"); module.setmemoallowed(true); module.saveozd("d:/ozp_test01.ozd", "OZP_TEST.ozr", "/", urls); catch(exception e) { e.printstacktrace(); Sample : RequestOZDSample.java import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import javax.servlet.servletconfig; import oz.server.ozservlet; import javax.servlet.servletexception; import java.io.*; import java.util.*; import oz.framework.cp.io.ozdataoutputstream; public class RequestOZDSample extends OZServlet { private static final int PROTOCOL_VER = 2005; private static final String _ROOT_PATH = "D:/"; private byte[] _buf = new byte[1024]; public void init(servletconfig config) throws ServletException { super.init(config); public void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { dopost(request, response); 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"; FORCS Co., LTD 35

36 OZ API Developer's Guide (for Java) // Make OZD makeozd(tempozdfile, request); catch(exception e) { ByteArrayOutputStream bout = new ByteArrayOutputStream(); e.printstacktrace(new PrintStream(bout)); bout.flush(); byte[] b = bout.tobytearray(); String error = new String(bout.toByteArray()); bout.close(); System.out.println(error); PrintWriter writer = response.getwriter(); writer.println("requestozdsample : Error"); writer.println(); writer.println(error); writer.flush(); private void writefile(string filename, OZDataOutputStream out) throws IOException { BufferedInputStream bin = null; try { ByteArrayOutputStream bout = new ByteArrayOutputStream(); int len; bin = new BufferedInputStream(new FileInputStream(filename)); while((len = bin.read(_buf)) >= 0) { bout.write(_buf, 0, len); bout.flush(); byte[] buf = bout.tobytearray(); bout.close(); out.writeint(buf.length); out.write(buf,0,buf.length); finally { if(bin!= null) { try { bin.close(); catch(exception ex) { private void makeozd(string filename, HttpServletRequest request) 36 FORCS Co., LTD

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

38 OZ API Developer's Guide (for Java) if(stream!= null) { try { stream.close(); catch(exception e) { // Util method public static int copy(inputstream is, OutputStream os) throws IOException { byte[] buf = new byte[1024]; int rt = 0; int len; while((len = is.read(buf)) >= 0) { os.write(buf, 0, len); rt += len; return rt; Sample : OZOZDMakerServlet.java package sample; import java.io.*; import java.io.ioexception; import java.util.hashtable; import javax.servlet.*; import javax.servlet.http.*; import oz.server.ozservlet; public class OZOZDMakerServlet extends OZServlet { private static final long serialversionuid = 1L; public void init(servletconfig config) throws ServletException{ super.init(config); public void doget(httpservletrequest req, HttpServletResponse res) throws ServletException, IOException { 38 FORCS Co., LTD

39 dopost(req, res); public void dopost(httpservletrequest req, HttpServletResponse res) throws ServletException, IOException { //getozdwithsdm. String inoutpath = "D:\\ServerRepository\\"; String ozrname = "SDM_OZD_MAKE_TEST.ozr"; String category = "/"; boolean ismemo = false; String reportpassword = null; String serverid = "admin"; String serverpwd = "admin"; Hashtable param = new Hashtable(); param.put("param1", "OZ PARAMETER ONE"); param.put("param2", "OZ PARAMETER TWO"); Hashtable sdm = new Hashtable(); FileInputStream fis1 = new FileInputStream(inOutPath + "SDM_OZD_MAKE_TEST.sdm"); FileInputStream fis2 = new FileInputStream(inOutPath + "SDM_OZD_MAKE_TEST1.sdm"); sdm.put("sdm_ozd_make_test", fis1); sdm.put("sdm_ozd_make_test1", fis2); InputStream is = null; FileOutputStream fos = null; try { //getozdwithsdm SDM. is = getozdwithsdm(ozrname, category, sdm, param, ismemo, reportpassword, serverid, serverpwd, req); fos = new FileOutputStream(inOutPath + RESULT.ozd"); byte[] buffer = new byte[1024]; int len = 0; while((len = is.read(buffer)) > 0) { fos.write(buffer, 0, len); catch(exception e) { e.printstacktrace(); finally { if(fos!= null) { fos.close(); if(is!= null) { is.close(); FORCS Co., LTD 39

40 OZ API Developer's Guide (for Java) fis1.close(); fis2.close(); public void detroy() { super.destroy(); 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 = " "; // 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 = { " // paramhash NULL addapplication Parameter 40 FORCS Co., LTD

41 //. 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(); Sample : MultiReportSample.java package sample; import oz.framework.api.*; public class MultiReportSample{ public static void main(string[] args) throws Exception{ Module maker = new Module(" "admin", "admin", true, false); String[] urls = new String[]{"file://D:\\pictures\\1.gif", "file://d:\\pictures\\2.gif", "file://d:\\pictures\\3.gif"; oz.framework.api.ireportinfo reportinfo = maker.addreport("parameter_test1.ozr", "/", "Report1""); reportinfo.addurl(urls); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 1"); reportinfo.addparameter("formparam", "form parameters 1"); reportinfo = maker.addreport("parameter_test2.ozr", "/", "Report2"); reportinfo.addurl(urls); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 2"); reportinfo.addparameter("formparam", "form parameters 2"); reportinfo = maker.addreport("parameter_test3.ozr", "/", "Report3"); reportinfo.addurl(urls); FORCS Co., LTD 41

42 OZ API Developer's Guide (for Java) number 3"); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form reportinfo.addparameter("formparam", "form parameters 3"); maker.saveozd("d:\\multireport.ozd"); 42 FORCS Co., LTD

43 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) url ip port Servlet URL ex) String url = " Daemon IP ex) String ip = " "; Daemon ex) int port = 8003; FORCS Co., LTD 43

44 OZ API Developer's Guide (for Java) id pw bautologin useusl ex) String id = "admin"; ex) String pw = "admin"; ex) boolean bautologin = true; USL ex) boolean useusl = false; Method Detail 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. 44 FORCS Co., LTD

45 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 = " "; // IP int PORT = 8003; // TCP FORCS Co., LTD 45

46 OZ API Developer's Guide (for Java) /*/ // Servlet String URL = " //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(); 46 FORCS Co., LTD

47 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 void setrepositoryconfig(sortproperties prop) SortProperties getrepositoryconfig() // User int createuser(string username, String pwd, int gid, String description) void deleteuser(int uid) void updateusername(int uid, String username) String getusernamebyid(int uid) // UserLogin void disableuserlogin(string username) void updatelogindefault(int logindval) void enableuserlogin(string username) void userlogout(int uid) boolean isuserlogin(int uid) boolean logintoserver() // UserPwd boolean checkuserpwd(int uid, String pwd) void updateuserpwd(int uid, String pwd) FORCS Co., LTD 47

48 OZ API Developer's Guide (for Java) // UserDesc void updateuserdescription(int uid, String description) String getuserdescription(int uid) // UserID int getgroupidofuser(int uid) int getuseridbyname(string username) void updategroupidofuser(int gid, int uid) // UserList OZRepositoryUser[] getuserlist() OZRepositoryUser[] getuserlistingroup(int gid) OZRepositoryUser[] getuserlistauthtoitem(int itemid, byte perm) OZRepositoryUser[] getuserlistauthtocategory(int categoryid, byte perm) // Group int creategroup(string groupname, int uppergid) void deletegroup(int gid) void updateuppergroupid(int gid, int uppergid) void updategroupname(int groupid, String groupname) // GroupAdmin void updateusergroupadmin(int uid, int gid) boolean isusergroupadmin(int uid, int gid) // GroupList OZRepositoryGroup[] getgrouplistingroup(int gid) OZRepositoryGroup getgroupinfo(int gid) OZRepositoryGroup[] getgrouplistauthtoitem(int itemid, byte perm) OZRepositoryGroup[] getgrouplistauthtocategory(int categoryid, byte perm) // Item int createitem(string itemname, int itemtype, String itemdescription, int cid, InputStream itemin) 48 FORCS Co., LTD

49 int createitem(string itemname, int itemtype, String itemdescription, String categoryname, InputStream itemin) int getitemid(string itemname, int itemtype, int cid) int getitemid(string itemname, int itemtype, String cname) void deleteitem(int itemid) InputStream getitem(int itemid) void updateitemname(int itemid, String itemname) InputStream getdirectitem(string itemname, int itemtype, String categoryname) InputStream getdirectitem(string itemname, int itemtype, String categoryname, boolean compresseditem) void updateitem(int itemid, InputStream input) void updatedirectitem(string itemname, int itemtype, String categoryname, InputStream input) boolean hasiteminrepository(string itemname, int itemtype, String categoryname) // InfoByItem int getcategoryidofitem(int itemid) void updatecategoryidofitem(int cid, int itemid) // ItemList OZRepositoryItem[] getitemlist() OZRepositoryItem getiteminfo(int itemid) OZRepositoryItem[] getitemlistincategory(int cid) OZRepositoryItem[] getitemlistincategory(string cname) OZRepositoryItem[] getitemlistincategory(int cid, int uid, byte perm) OZRepositoryItem[] getitemlistincategory(string categoryname, int uid, byte perm) OZRepositoryItem[] getitemlistincategoryauthgroup(int cid, int gid, byte perm) OZRepositoryItem[] getitemlistincategoryauthgroup(string categoryname, int gid, byte perm) OZRepositoryItem[] getitemlistauthtouser(int uid, byte perm) OZRepositoryItem[] getitemlistauthtogroup(int gid, byte perm) FORCS Co., LTD 49

50 OZ API Developer's Guide (for Java) // Category int createcategory(string categoryname, int uppercid) int createcategory(string categorypath) void deletecategory(int cid) int getcategoryid(string fullpath) void updateuppercategoryid(int cid, int uppercid) void updatecategoryname(int cid, String categoryname) int getitemcountincategory(int cid) OZRepositoryCategory[] getcategorylistincategory(int cid) OZRepositoryCategory[] getcategorylistincategory(int cid, int uid, byte perm) OZRepositoryCategory[] getcategorylistincategoryauthgroup(int cid, int gid, byte perm) OZRepositoryCategory getcategoryinfo(int cid) OZRepositoryCategory[] getcategorylistauthtouser(int uid, int cid, byte perm) OZRepositoryCategory[] getcategorylistauthtogroup(int gid, int cid, byte perm) // CheckInOut void checkoutitem(int itemid, int uid, String checkoutfolder) void undocheckoutitem(int itemid, int uid) void checkinitem(boolean keepchkout, int itemid, int uid, InputStream itemin) boolean ischeckoutuser(int itemid, int uid) // History void rollbackitem(int itemid, int itemversion) InputStream getspecifiedversionitem(int itemid, int itemversion) OZRepositoryHistory[] gethistoryitemlist(int itemid) void clearhistoryitem(int itemid, int itemversion) Constructor Detail 50 FORCS Co., LTD

51 //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) url ip port id pw bautologin useusl Servlet URL ex) String url = " Daemon IP ex) String ip = " "; 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. "repository.properties", Key. prop getrepositoryconfig FORCS Co., LTD 51

52 OZ API Developer's Guide (for Java) 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"); // User createuser public int createuser(string username, String pwd, int gid, String description) throws OZCPException, ID. username 52 FORCS Co., LTD

53 pwd gid description ID deleteuser public void deleteuser(int uid) throws OZCPException ID. uid ID updateusername public void updateusername(int uid, String username) throws OZCPException ID. uid username ID getusernamebyid public String getusernamebyid(int uid) throws OZCPException ID. uid ID // UserLogin disableuserlogin public void disableuserlogin(string username) throws OZCPException. username updatelogindefault public void updatelogindefault(int logindval) throws OZCPException ID. logindval ID FORCS Co., LTD 53

54 OZ API Developer's Guide (for Java) enableuserlogin public void enableuserlogin(string username) throws OZCPException. username userlogout public void userlogout(int uid) throws OZCPException ID,. uid ID isuserlogin public boolean isuserlogin(int uid) throws OZCPException ID,. uid ID logintoserver public boolean logintoserver() throws OZCPException. // UserPwd checkuserpwd public boolean checkuserpwd(int uid, String pwd) throws OZCPException. uid pwd ID updateuserpwd public void updateuserpwd(int uid, String pwd) throws OZCPException ID. uid ID 54 FORCS Co., LTD

55 pwd // UserDesc updateuserdescription public void updateuserdescription(int uid, String description) throws OZCPException ID. uid description ID getuserdescription public String getuserdescription(int uid) throws OZCPException ID. uid ID // UserID getgroupidofuser public int getgroupidofuser(int uid) throws OZCPException ID ID. uid ID ID getuseridbyname public int getuseridbyname(string username) throws OZCPException ID. username ID updategroupidofuser public void updategroupidofuser(int gid, int uid) throws OZCPException ID. gid uid ID ID ID FORCS Co., LTD 55

56 OZ API Developer's Guide (for Java) // UserList getuserlist public OZRepositoryUser[] getuserlist() throws OZCPException. getuserlistingroup public OZRepositoryUser[] getuserlistingroup(int gid) throws OZCPException ID. gid ID getuserlistauthtoitem public OZRepositoryUser[] getuserlistauthtoitem(int itemid, byte perm) throws OZCPException ID perm. itemid perm ID getuserlistauthtocategory public OZRepositoryUser[] getuserlistauthtocategory(int categoryid, byte perm) throws OZCPException ID perm. categoryid perm ID // Group creategroup public int creategroup(string groupname, int uppergid) throws OZCPException, ID. groupname uppergid ID 56 FORCS Co., LTD

57 deletegroup public void deletegroup(int gid) throws OZCPException ID. gid ID updategroupname public void updategroupname(int gid, String groupname) throws OZCPException ID. gid groupname ID // GroupAdmin updateusergroupadmin public void updateusergroupadmin(int uid, int gid) throws OZCPException ID. uid gid ID ID isusergroupadmin public boolean isusergroupadmin(int uid, int gid) throws OZCPException ID. uid ID gid ID // GroupList getgrouplistingroup public OZRepositoryGroup[] getgrouplistingroup(int gid) throws OZCPException ID. gid ID FORCS Co., LTD 57

58 OZ API Developer's Guide (for Java) getgroupinfo public OZRepositoryGroup getgroupinfo(int gid) throws OZCPException ID. gid ID getgrouplistauthtoitem public OZRepositoryGroup[] getgrouplistauthtoitem(int itemid, byte perm) throws OZCPException ID perm. itemid ID perm getgrouplistauthtocategory public OZRepositoryGroup[] getgrouplistauthtocategory(int categoryid, byte perm) throws OZCPException ID perm. categoryid ID perm getsubgrouplist public OZRepositoryGroup[] getsubgrouplist(int gid) throws OZCPException. getgrouplistingroup() getsubgrouplist() Recursive.,.... gid ID groupname // Item createitem 58 FORCS Co., LTD

59 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. 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. itemname itemtype cid cname ID deleteitem public void deleteitem(int itemid) throws OZCPException. itemid ID getitem public InputStream getitem(int itemid) throws OZCPException ID. FORCS Co., LTD 59

60 OZ API Developer's Guide (for Java) itemid ID updateitemname public void updateitemname(int itemid, String itemname) throws OZCPException ID. 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. itemname itemtype categoryname compresseditem updateitem public void updateitem(int itemid, InputStream input) throws OZCPException ID. itemid input ID updatedirectitem public void updatedirectitem(string itemname, int itemtype, String categoryname, InputStream input) throws OZCPException ID. itemname itemtype 60 FORCS Co., LTD

61 categoryname input hasiteminrepository public boolean hasiteminrepository(string itemname, int itemtype, String categoryname) throws OZCPException. itemname itemtype categoryname // InfoByItem getcategoryidofitem public int getcategoryidofitem(int itemid) throws OZCPException ID ID. itemid ID updatecategoryidofitem public void updatecategoryidofitem(int cid, int itemid) throws OZCPException ID. cid itemid ID ID // ItemList getitemlist public OZRepositoryItem[] getitemlist() throws OZCPException. getiteminfo public OZRepositoryItem getiteminfo(int itemid) throws OZCPException ID. FORCS Co., LTD 61

62 OZ API Developer's Guide (for Java) 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. 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. cid gid perm categoryfullpath ID ID getitemlistauthtouser public OZRepositoryItem[] getitemlistauthtouser(int uid, byte perm) throws OZCPException 62 FORCS Co., LTD

63 ID perm. uid perm ID getitemlistauthtogroup public OZRepositoryItem[] getitemlistauthtogroup(int gid, byte perm) throws OZCPException ID perm. gid perm ID // Category createcategory public int createcategory(string categoryname, int uppercid) throws OZCPException, ID. categoryname uppercid ID createcategory public int createcategory(string categorypath) throws OZCPException, ID. categorypath deletecategory public void deletecategory(int cid) throws OZCPException ID. cid ID getcategoryid FORCS Co., LTD 63

64 OZ API Developer's Guide (for Java) public int getcategoryid(string fullpath) throws OZCPException ID. fullpath ID updateuppercategoryid public void updateuppercategoryid(int cid, int uppercid) throws OZCPException ID. cid uppercid ID ID updatecategoryname public void updatecategoryname(int cid, String categoryname) throws OZCPException ID. cid categoryname ID getitemcountincategory public int getitemcountincategory(int cid) throws OZCPException. cid ID getcategorylistincategory public OZRepositoryCategory[] getcategorylistincategory(int cid) throws OZCPException public OZRepositoryCategory[] getcategorylistincategory(int cid, int uid, byte perm) throws OZCPException. cid uid perm ID ID 64 FORCS Co., LTD

65 getcategoryinfo public OZRepositoryCategory getcategoryinfo(int cid) throws OZCPException. cid ID getcategorylistauthtouser public OZRepositoryCategory[] getcategorylistauthtouser(int uid, int cid, byte perm) throws OZCPException ID perm. uid cid perm ID ID getcategorylistauthtogroup public OZRepositoryCategory[] getcategorylistauthtogroup(int gid, int cid, byte perm) throws OZCPException ID perm. gid cid perm ID ID // CheckInOut checkoutitem public void checkoutitem(int itemid, int uid, String checkoutfolder) throws OZCPException ID. itemid uid checkoutfolder ID ID undocheckoutitem FORCS Co., LTD 65

66 OZ API Developer's Guide (for Java) public void undocheckoutitem(int itemid, int uid) throws OZCPException ID. itemid uid ID ID checkinitem public void checkinitem(boolean keepchkout, int itemid, int uid, InputStream itemin) throws OZCPException ID. keepchkout itemid uid itemin ID ID ischeckoutuser public boolean ischeckoutuser(int itemid, int uid) throws OZCPException. itemid uid ID ID // History getspecifiedversionitem public InputStream getspecifiedversionitem(int itemid, int itemversion) throws OZCPException ID. itemid itemversion ID gethistoryitemlist public OZRepositoryHistory[] gethistoryitemlist(int itemid) throws OZCPException. 66 FORCS Co., LTD

67 itemid ID clearhistoryitem public void clearhistoryitem(int itemid, int itemversion) throws OZCPException. itemid itemversion ID rollbackitem public void rollbackitem(int itemid, int itemversion) throws OZCPException. itemid itemversion ID Class OZRepositoryUser(oz.framework.repository.OZRepositoryUser),,,,. - getusername public String getusername(). getuserid public int getuserid() ID. getgrouplist public java.util.vector getgrouplist(). FORCS Co., LTD 67

68 OZ API Developer's Guide (for Java) 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() ID. getisloginenabled public boolean getisloginenabled() 68 FORCS Co., LTD

69 . 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(). getindirectpermission public byte getindirectpermission(). FORCS Co., LTD 69

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

71 : ODI_FILE : OZR_FILE : SDM_FILE : USDM_FILE : OZD_FILE : 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() FORCS Co., LTD 71

72 OZ API Developer's Guide (for Java). 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. getcategoryadminlist 72 FORCS Co., LTD

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

74 OZ API Developer's Guide (for Java) 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.*; public class RepositorySample { private static Repository repository = null; 74 FORCS Co., LTD

75 public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. //* // Daemon String IP = " "; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = " //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"); prop.setproperty("repository_item_number_per_directory", "100"); prop.setproperty("repository_history_item_valid_days", "20"); FORCS Co., LTD 75

76 OZ API Developer's Guide (for Java) //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"; createfile(filename); 76 FORCS Co., LTD

77 // 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; cid = repository.createcategory(childcategoryname, parent_cid); System.out.println("New new_category_name [new_categoryid] : " + FORCS Co., LTD 77

78 OZ API Developer's Guide (for Java) 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, authview); showcategoryinfolist(categoryinfolist); 78 FORCS Co., LTD

79 // 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()); System.out.println("CategoryName : " + c.getcategoryname()); System.out.println("CategoryUpperId : " + c.getparentcategoryid()); FORCS Co., LTD 79

80 OZ API Developer's Guide (for Java) 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 //. System.out.println( "Repository.getItemListInCategory(String cname,int userid, 80 FORCS Co., LTD

81 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"; int[] oper = {2, 2; //1 => AND, 2 => OR iteminfolist = repository.finditembyitemindex(itemindex, oper); FORCS Co., LTD 81

82 OZ API Developer's Guide (for Java) 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)); private static void itemtest() throws Exception { final String itemfilename = " 100.odi"; 82 FORCS Co., LTD

83 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); //. System.out.println("Repository.updateItemName(int itemid, FORCS Co., LTD 83

84 OZ API Developer's Guide (for Java) 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[" + categoryname + "]? " + repository.hasiteminrepository(itemname, itemtype, 84 FORCS Co., LTD

85 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)); final byte authread = 0x02; groupinfolist = repository.getgrouplistauthtoitem(itemid, authread); FORCS Co., LTD 85

86 OZ API Developer's Guide (for Java) 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", " ", gid, ""); System.out.println("Before : "); showgroupadminusername(repository.getgroupinfo(gid).getgroupadminlist ()); 86 FORCS Co., LTD

87 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 = "( "; System.out.println("Before Update GroupIDofUser : " + (repository.getgroupinfo(gid)).getgroupname()); repository.updategroupname(gid, newgroupname); System.out.println("After Update GroupIDofUser : " + FORCS Co., LTD 87

88 OZ API Developer's Guide (for Java) (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)"); userinfolist = repository.getuserlistingroup(gid); showuserinfolist(userinfolist); //. 88 FORCS Co., LTD

89 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 : " + repository.getgroupidofuser(uid)); //. System.out.println("Repository.getUserIdbyName(String user_name)"); FORCS Co., LTD 89

90 OZ API Developer's Guide (for Java) 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 + "'"); // username login enable. System.out.println("Repository.enableUserLogin(String username)"); repository.enableuserlogin("'" + username + "'"); 90 FORCS Co., LTD

91 //. 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); //. System.out.println("Repository.deleteUser(int uid)"); repository.deleteuser(uid); FORCS Co., LTD 91

92 OZ API Developer's Guide (for Java) Constructor Summary Service(String ip, int port, String id, String pw, boolean bautologin, boolean useusl) Service(String url, String id, String pw, boolean bautologin, boolean useusl) Method Summary void garbagecollect() void stop(boolean check) void restart() boolean ping() 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) url ip port Servlet URL ex) String url = " Daemon IP ex) String ip = " "; Daemon ex) int port = 8003; 92 FORCS Co., LTD

93 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. check true : false : restart public void restart() throws OZCPException. ping public boolean ping(). FORCS Co., LTD 93

94 OZ API Developer's Guide (for Java) Sample : ServiceSample.java package sample; import oz.framework.api.service; import org.apache.log4j.*; public class ServiceSample { public static void main(string[] args) { //. BasicConfigurator.configure(); // OZServer Info. // * // Daemon String IP = " "; // IP int PORT = 8003; // TCP String URL = " /******************************************************************** *** * / // Servlet String URL = " //Servlet * URL / **********************************************************************/ false); // User Info. String ID = "admin"; // default String PWD = "admin"; // default Service service = null; try { // * // Daemon service = new Service(IP, PORT, ID, PWD, false, //service = new Service(URL, ID, PWD, false, false); /***************************************************************** false, false); / * / // Servlet service = new Service(URL, ID, PWD, ******************************************************************/ // ping 94 FORCS Co., LTD

95 boolean isalive = service.ping(); // if(isalive == true) { System.out.println("Server is Running"); // System.out.println(service.getHandlerCount()); // garbagecollection (garbagecollects) service.garbagecollect(); // (restart) // service.restart(); // (serverstop) boolean check = true;// service.stop(check); stoped"); //. isalive = true; while (isalive) { isalive = service.ping(); if(isalive == false) { System.out.println("Server is // else { System.out.println("Server is dead"); catch (Exception e) { e.printstacktrace(); FORCS Co., LTD 95

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

97 //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) url ip port id pw bautologin useusl Servlet URL ex) String url = " Daemon IP ex) String ip = " "; 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. reportname categoryname getform public InputStream getform(string reportname, String categoryname, boolean iscompress) throws OZCPException FORCS Co., LTD 97

98 OZ API Developer's Guide (for Java). reportname categoryname iscompress getuserparameterswithdefaultvalue public Parameter[] getuserparameterswithdefaultvalue(string itemname, int itemtype, String categoryname) throws OZCPException. itemname itemtype (OZR : / ODI : 10000) categoryname iscompress gethcusdm public HCDataModule gethcusdm(string filename, String categoryname) throws OZCPException SDM. filename categoryname getdatamodules public HCDataModule getdatamodule(inputstream sdminput) throws OZCPException SDM. FETCH (batch), DataModule 2.5 Normal. sdminput SDM getdatamodules 98 FORCS Co., LTD

99 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. odiname categoryname parameters docompress forcerefresh invaliddataset maxrows Class Parameter(oz.dm.Parameter). - public String name : public String value : MaxRowsOfSet (oz.dm. MaxRowsOfSet). - SetSetName public void SetSetName(String v). GetSetName public String GetSetName() FORCS Co., LTD 99

100 OZ API Developer's Guide (for Java). 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. name PrintInfo public void PrintInfo(PrintStream out) PrintStream. out PrintStream 100 FORCS Co., LTD

101 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 = " "; // IP int PORT = 8003; // TCP /*/ // Servlet String URL = " //Servlet URL FORCS Co., LTD 101

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

103 // (getdatamodules) HCDataModule dmodule2 = viewer.getdatamodule( odiname, categoryname, param,compress, force, invalidset, mx); catch (Exception e) { e.printstacktrace(); FORCS Co., LTD 103

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

105 API Class Program Class Publisher Class Scheduler Class TaskHolidayInfo Class TaskHolidayGroupInfo FORCS Co., LTD 105

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

107 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 ip port IP ex) String ip = " "; (:9521) ex) int port = 9521; Method Detail createfolder public void createfolder(serverinfo s, String folder) throws SchedulerException. FORCS Co., LTD 107

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

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

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

111 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 = " "; // 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, //' *. 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";// FORCS Co., LTD 111

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

113 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 ip port IP ex) String ip = " "; (:9521) ex) int port = 9521; Method Detail createfolder public void createfolder(serverinfo s, String folder) throws SchedulerException. FORCS Co., LTD 113

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

115 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 = " "; // 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, //' *. Server Servlet Type.*/ FORCS Co., LTD 115

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

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

118 OZ API Developer's Guide (for Java) boolean addtaskholidayinfo(taskholidayinfo value) boolean modifytaskholidayinfo(string old_key, TaskHolidayInfo new_value) boolean deletetaskholidayinfo(string key) boolean deletetaskholidayinfo(string[] keys) boolean addtaskholidaygroupinfo(taskholidaygroupinfo value) boolean modifytaskholidaygroupinfo(string old_key, TaskHolidayInfo new_value) boolean deletetaskholidaygroupinfo(string key) OZMap gettaskholidayinfolist() OZMap gettaskholidaygroupinfolist() void savetaskholiday() Constructor Detail ppublic scheduler(string ip, int port) ip port IP ex) String ip = " "; (:9521) ex) int port = 9521; Method Detail createtask public String createtask(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException ID. : CreateTask Thread param. s 118 FORCS Co., LTD

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

120 OZ API Developer's Guide (for Java) s taskid modifytask public String modifytask(serverinfo s, String taskid, SortProperties configmap, SortProperties exportmap) throws SchedulerException. s taskid configmap exportmap key "Option". key "Option". taskpause public boolean taskpause(serverinfo s, String taskid) throws SchedulerException. s taskid taskresume public boolean taskresume(serverinfo s, String taskid) throws SchedulerException. s taskid stop public void stop(serverinfo s, boolean waittaskid) throws SchedulerException 120 FORCS Co., LTD

121 . s waittaskid export public boolean export(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException. : "ViewType=None". :.pdf,.ozd,.html,.jpg,.xls,.doc,.svg,.txt,.ppt,.tif, csv. s configmap exportmap key "Option". key "Option". : export API COM ASP "Appendix 1. SchedulerCOM ". makepdf public boolean makepdf(serverinfo s, SortProperties configmap, SortProperties exportmap) throws SchedulerException PDF. : "ViewType=None". s FORCS Co., LTD 121

122 OZ API Developer's Guide (for Java) configmap exportmap key "Option". creattask() PDF. PDF key "Option". creattask() PDF. : makepdf API COM ASP "Appendix 1. SchedulerCOM ". print public boolean print(serverinfo s, SortProperties configmap, SortProperties printmap) throws SchedulerException. ( ) : "task_type=viewertag". "ViewType=None". s configmap exportmap key "Option". key "Option"., print.mode = silent. print API, print API. print API. viewer.allowmultiframe=true viewer.mode=print 122 FORCS Co., LTD

123 viewer.printcommand=true viewer.showerrormessage=false viewer.useprogressbar=false print.ingnoreerror=false print.mode=silent export.confirmsave=false export.format="" information.debug=debug getconfiguration public SortProperties getconfiguration(serverinfo s) throws SchedulerException. s modifyconfiguration public void modifyconfiguration(serverinfo s, SortProperties configmap) throws SchedulerException. s configmap key "Option". ping public boolean ping(). getozslist public String[] getozslist(string path) OZS. (path OZS, path OZS..) FORCS Co., LTD 123

124 OZ API Developer's Guide (for Java) path OZS : OZS /%SCH_HOME%/[path]/. path sample /%SCH_HOME%/sample/ OZS. ozsverconv public void ozsverconv(string oldpath, String newpath) throws SchedulerException 2.5 OZS. oldpath newpath OZS : /%SCH_HOME%/[oldPath]/. OZS : /%SCH_HOME%/[newPath]/ newpath oldpath. addtaskholidayinfo public boolean addtaskholidayinfo(taskholidayinfo value) throws SchedulerException. value modifytaskholidayinfo public boolean modifytaskholidayinfo(string old_key, TaskHolidayInfo new_value) throws SchedulerException. old_key new_value deletetaskholidayinfo // public boolean deletetaskholidayinfo(string[] keys) throws SchedulerException // 124 FORCS Co., LTD

125 public boolean deletetaskholidayinfo(string key) throws SchedulerException. key addtaskholidaygroupinfo public boolean addtaskholidaygroupinfo(taskholidaygroupinfo value) throws SchedulerException. value modifytaskholidaygroupinfo public boolean modifytaskholidaygroupinfo(string old_key, TaskHolidayGroupInfo new_value) throws SchedulerException. old_key new_value deletetaskholidaygroup public boolean deletetaskholidaygroupinfo(string key) throws SchedulerException. key gettaskholidayinfolist public OZMap gettaskholidayinfolist() throws SchedulerException. gettaskholidaygroupinfolist public OZMap gettaskholidaygroupinfolist() throws SchedulerException. FORCS Co., LTD 125

126 OZ API Developer's Guide (for Java) savetaskholiday public void savetaskholiday() throws SchedulerException xml. Class ServerInfo(oz.scheduler.ServerInfo) Program class " class". SortProperties (oz.util.sortproperties) Cache class " class". TaskHolidayInfo(oz.scheduler.Holiday) TaskHolidayInfo class " class". TaskHolidayGroupInfo(oz.scheduler.Holiday) TaskHolidayInfo class " class". Option - "ViewType" "None", API, OZD. -,. applet.mode viewer.mode applet.useprogressbar viewer.useprogressbar applet.allowmultiframe export export false false true 126 FORCS Co., LTD

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

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

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

130 OZ API Developer's Guide (for Java) "[FORM].". empno "[FORM].empNo". ODI ODI. ODI "testodi" "id" "testodi.id". ODI Key Value odi_parameter_ count ex) setproperty("odi_parameter_count", "1") odi_parameter_name_1... odi_parameter_name_n (n : ) ex) setproperty("odi_parameter_name_1", "id") odi_parameter_value_1... odi_parameter_value_n (n : ) ex) setproperty("odi_parameter_value_1", " 10") : ODI, ODI ODI. - Key Value launch_type "once" "immediately" "periodically" once : immediately : periodically : ex) setproperty("launch_type", "once") launch_ type = once Key Value 130 FORCS Co., LTD

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

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

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

134 OZ API Developer's Guide (for Java) repeat_end_hour repeat_end_minute ex) setproperty("repeat_end_hour", 09") ex) setproperty("repeat_end_minute", "35") : periodically_ execution_time_ type = user_defined Key Value user_defined_time (:) (,) ex) setproperty("user_defined_time", "01:30,13:30") CSV Key Value csv.filename csv.pagetitle csv.pageline csv.pagestyle csv.separator "page" "none" "# <page>" "# <page> -- -" "--- #<page>" "<page> #" "Tab" "Space" "Comma" CSV ex) setproperty("csv.filename","test.csv") ex) setproperty("csv.pagetitle", "<<Page>>") ex) setproperty("csv.pageline ", "7") (:none - ) ex) setproperty("csv.pagestyle", "none") CSV ex) setproperty("csv.separator", "Tab") 134 FORCS Co., LTD

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

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

137 Jpeg Key Value jpg.filename JPEG ex) setproperty("jpg.filename", "test.jpg") OZD Key Value ozd.filename ozd.memoallowe d ozd.saveall ozd.password "true" "false" "true" "false" OZD ex) setproperty("ozd. filename ", "test.ozd") true : () false : ex) setproperty("ozd. memoallowed ", "true") : Direct true : () false : ex) setproperty("ozd.saveall ", "true") ex) setproperty("ozd.password", "admin") PDF Key Value pdf.filename PDF ex) setproperty("pdf.filename", "test.pdf") pdf.saverange pdf.title pdf.subject pdf.creator (", " ) ex) setproperty("pdf.saverange ", "1.3") PDF ex) setproperty("pdf.title", "Report") PDF ex) setproperty("pdf.title", "Report") ex) setproperty("pdf.creator", "Forcs") FORCS Co., LTD 137

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

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

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

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

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

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

144 OZ API Developer's Guide (for Java) // word {"word.filename ", "test.doc", //word // ppt {"ppt.filename ", "test.ppt ", //ppt // jpg {"jpg.filename ", "test.jpg ", //jpg ; // svg {"svg.filename ", "test.svg" //svg private static String[][] schedulerrelatedproperties = { {"SchedulerPort", "9521", // {"schedulerserver", "%SCH_HOME%/ScheduledTask", // {"SMTPServer", "mail.forcs.com", //SMTP {"SMTPServerPort", "25", //SMTP {"MailFrom", "kil_dong@forcs.com",// {"TempRepositoryFilePath", "%SCH_HOME%/TempRepository", // {"RepositoryFileRootPath", "%SCH_HOME%/Repository", //PDF {"ExternalProgramFilePath", "%SCH_HOME%/External", // {"ErrorNotifyToSender", "false" // ; public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = " "; // IP int PORT = 9521; // TCP String[][] values = null; Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); //ping boolean result = scheduler.ping(); if(result) { System.out.println("Scheduler is running"); // 144 FORCS Co., LTD

145 else { System.out.println("Scheduler is Dead"); // // 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, //' *. Server Servlet Type.*/ // (createtask) // //. //check, uncheck "check", "null". SortProperties props = new SortProperties(); setproperties(props, mailrelatedproperties); SortProperties exportmap = new SortProperties(); setproperties(exportmap, attachrelatedproperties); scheduler.createtask(serverinfo, props, exportmap); scheduler.makepdf(serverinfo, props, exportmap); scheduler.makepdfbypooling(serverinfo, props, exportmap); // (modifyconfiguration) SortProperties pro = new SortProperties(); setproperties(pro, schedulerrelatedproperties); scheduler.modifyconfiguration(serverinfo, pro); // (getconfiguration) pro = scheduler.getconfiguration(serverinfo); pro.list(system.out); /* * (gettask) * *, *. */ ScheduledTask stask = new ScheduledTask(); FORCS Co., LTD 145

146 OZ API Developer's Guide (for Java) // setting stask.taskid = "parameter_test.ozs"; // stask.reportname = "/parameter_test"; // stask.schedulingtypestr = "Periodically"; // stask.lastruntimestr = ""; // stask.nextruntimestr = " :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 = " :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 = " "; // String to = " "; // TaskResult[] trlist = scheduler.gettaskresult(serverinfo, from, to, tr.taskid); for (int i = 0; i < trlist.length; i++) { showtaskresult(trlist[i]); String task = stask.taskid; // // (taskpause) boolean b = scheduler.taskpause(serverinfo, task); // (taskresume) boolean bool = scheduler.taskresume(serverinfo, task); // (removetask) scheduler.removetask(serverinfo, task); //.(stop) boolean waittask = true; // boolean 146 FORCS Co., LTD

147 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(""); Sample : SchedulerViewerTagSample.java package sample; import oz.framework.api.*; import oz.scheduler.taskresult; import oz.scheduler.serverinfo; FORCS Co., LTD 147

148 OZ API Developer's Guide (for Java) 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(" ", 9521); // ServerInfo serverinfo = new ServerInfo(); serverinfo.setid("admin"); // serverinfo.setpwd("admin"); // serverinfo.setisdaemon(true); serverinfo.setip(" "); //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", " "); export.setproperty("connection.port", "8003"); export.setproperty("connection.reportname", "/parameter_test.ozr"); export.setproperty("applet.mode", "export"); export.setproperty("applet.useprogressbar", "false"); export.setproperty("applet.allowmultiframe", "true"); export.setproperty("connection.pcount", "2"); export.setproperty("connection.args1", "formparam1="); export.setproperty("connection.args2", "formparam2="); export.setproperty("export.mode", "silent"); 148 FORCS Co., LTD

149 // 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", " "); export.setproperty("child1.connection.port", "8003"); export.setproperty("child1.connection.reportname", "/parameter_test.ozr"); export.setproperty("child1.applet.mode", "export"); export.setproperty("child1.applet.useprogressbar", "false"); export.setproperty("child1.applet.allowmultiframe", "true"); export.setproperty("child1.export.mode", "silent"); export.setproperty("child1.connection.fetchtype", "BATCH"); export.setproperty("child1.export.confirmsave", "false"); export.setproperty("child1.information.debug", "debug"); export.setproperty("child1.applet.showerrormessage", "false"); export.setproperty("child1.connection.pcount", "2"); export.setproperty("child1.connection.args1", "formparam1= 1"); export.setproperty("child1.connection.args2", "formparam2= 2"); export.setproperty("child1.odi.odinames", "parameter_test"); export.setproperty("child1.odi.parameter_test.pcount", "2"); export.setproperty("child1.odi.parameter_test.args1", "odiparam1= 3"); export.setproperty("child1.odi.parameter_test.args2", "odiparam2= 4"); FORCS Co., LTD 149

150 OZ API Developer's Guide (for Java) //. 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); Sample : SchedulerTaskResult.java package sample; import oz.framework.api.*; import oz.scheduler.taskresult; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; public class SchedulerTaskResult { public static void main(string[] args) { String IP = " "; //scheduler server ip int PORT = 9521; //scheduler server port Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); // scheduler Server Info ServerInfo serverinfo = new ServerInfo(); 150 FORCS Co., LTD

151 daemon serverinfo.setip(" "); //OZ Server IP conf. In case use of serverinfo.setportno(8003); serverinfo.setisdaemon(true);//oz Server Type. -> daemon, servlet serverinfo.setid("admin"); //id serverinfo.setpwd("admin"); //pw ScheduledTask[] tasklist = scheduler.gettask(serverinfo); for (int k = 0; k < tasklist.length; k++) { showtask(tasklist[k]); System.out.println("\n\n"); TaskResult tr = new TaskResult(); tr.taskid = tasklist[k].taskid; String from = ""; //Task Result Start time String to = ""; //Task Result Endt time boolean iscomplete = false; TaskResult[] trlist = scheduler.gettaskresult(serverinfo, from, to, tr.taskid); if (trlist.length > 0) { for (int i = 0; i < trlist.length; i++) { showtaskresult(trlist[i]); iscomplete = true; catch(exception e) { e.printstacktrace(); private static void showtask(scheduledtask t) { System.out.println("TASK ID : " + t.taskid); System.out.println("Report Name : " + t.reportname); System.out.println("Type : " + t.schedulingtypestr); System.out.println("Finish Execute Time : " + t.lastruntimestr); System.out.println("Next Execute Time : " + t.nextruntimestr); System.out.println("Status : " + t.status); System.out.println(""); FORCS Co., LTD 151

152 OZ API Developer's Guide (for Java) private static void showtaskresult(taskresult tr) { System.out.println("TASK ID : " + tr.taskid); System.out.println("TASK FINISH TIME : " + tr.completedtime); System.out.println("Is Sucessed Code : " + tr.issuccessfulcode); System.out.println("Is Sucessed? : " + tr.issuccessful); System.out.println("Report Name : " + tr.formfilename); System.out.println("Parameter : " + tr.paraminfo); System.out.println("Type : " + tr.schedulingtype); System.out.println("Error Message : " + tr.errormsg); System.out.println(""); Sample : SchedulerTaskModify.java package sample; import org.apache.log4j.*; import oz.framework.api.*; import oz.scheduler.serverinfo; import oz.scheduler.scheduledtask; import oz.util.sortproperties; public class SchedulerTaskModify { public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = " "; // IP int PORT = 9521; // Port Scheduler scheduler = null; String taskid = null; try { scheduler = new Scheduler(IP, PORT); // OZ Server ServerInfo serverinfo = new ServerInfo(); serverinfo.setip(" "); // IP serverinfo.setportno(8003); // Port 152 FORCS Co., LTD

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

154 OZ API Developer's Guide (for Java) Sample : SchedulerPrint.java package sample; import org.apache.log4j.basicconfigurator; import oz.framework.api.scheduler; import oz.scheduler.schedulerexception; import oz.scheduler.serverinfo; import oz.util.sortproperties; public class SchedulerPrint { public static void main(string[] args) { //. BasicConfigurator.configure(); // String IP = " "; // IP int PORT = 9521; // Port try { Scheduler scheduler = new Scheduler(IP, PORT); // OZ Server ServerInfo serverinfo = new ServerInfo(); serverinfo.setip(" "); // IP serverinfo.setportno(8003); // Port serverinfo.setisdaemon(true); // serverinfo.setid("admin"); // ID serverinfo.setpwd("admin"); // Password SortProperties config = new SortProperties(); // print task_type viewertag. config.setproperty("task_type", "viewertag"); config.setproperty("launch_type", "immediately"); SortProperties printmap = new SortProperties(); printmap.setproperty("connection.server", " "); printmap.setproperty("connection.port", "8003"); printmap.setproperty("connection.reportname", "/parameter_test.ozr"); 154 FORCS Co., LTD

155 printmap.setproperty("repository_agent.try_license_check", "true"); printmap.setproperty("connection.pcount", "2"); printmap.setproperty("connection.args1", "formparam1="); printmap.setproperty("connection.args2", "formparam2="); printmap.setproperty("connection.fetchtype", "BATCH"); printmap.setproperty("odi.parameter_test.pcount", "2"); printmap.setproperty("odi.parameter_test.args1", "odiparam1="); printmap.setproperty("odi.parameter_test.args2", "odiparam2="); printmap.setproperty("odi.odinames", "parameter_test"); //print ( ) printmap.setproperty("print.adjust", "true"); printmap.setproperty("print.alldocument", "false"); printmap.setproperty("print.close", "true"); printmap.setproperty("print.collate", "true"); printmap.setproperty("print.copies", "1"); printmap.setproperty("print.duplex", "none"); printmap.setproperty("print.gray", "true"); printmap.setproperty("print.ignoreerror", "true"); printmap.setproperty("print.lockopt", "true"); printmap.setproperty("print.once", "false"); printmap.setproperty("print.orientation", "default"); printmap.setproperty("print.pageorient", "horizontal"); printmap.setproperty("print.pagerange", "all"); printmap.setproperty("print.printbypage", "true"); printmap.setproperty("print.printername", "default"); printmap.setproperty("print.scaling", "100"); printmap.setproperty("print.size", "A4"); printmap.setproperty("print.spoolpages", "100"); printmap.setproperty("print.style", "normal"); printmap.setproperty("print.usedefaultpaper", "false"); printmap.setproperty("print.spoolpages", "100"); printmap.setproperty("print.usedialogopt", "true"); // printmap.setproperty("viewer.childcount", "1"); printmap.setproperty("child1.connection.server", " "); printmap.setproperty("child1.connection.port", "8003"); printmap.setproperty("child1.connection.reportname", "/module_sample.ozr"); printmap.setproperty("child1.connection.fetchtype", "BATCH"); // API EM. Boolean result = scheduler.print(serverinfo, config, printmap); if(result == true) { System.out.println("Success Print"); else { System.out.println("Failed Print"); FORCS Co., LTD 155

156 OZ API Developer's Guide (for Java) catch (SchedulerException se) { se.printstacktrace(); Sample : SchedulerTaskConverter.java package sample; import org.apache.log4j.basicconfigurator; import oz.framework.api.scheduler; public class SchedulerTaskConverter { public static void main(string[] args) { BasicConfigurator.configure(); String IP = " "; //scheduler server ip int PORT = 9521; //scheduler server port Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); // /%SCH_HOME%/ScheduledTask ozs ( OZS ) String[] ozslist = scheduler.getozslist("/scheduledtask"); for(int i=0 ; i < ozslist.length ; i++) { System.out.println(ozsList[i]); // /%SCH_HOME%/ScheduledTask ozs /%SCH_HOME%/ConvertedTask scheduler.ozsverconv("/scheduledtask", "/ConvertTask"); // /%SCH_HOME%/ ConvertTask ozs ( OZS ) ozslist = scheduler.getozslist("/converttask"); for(int i=0 ; i < ozslist.length ; i++) { System.out.println(ozsList[i]); catch(exception e) { 156 FORCS Co., LTD

157 e.printstacktrace(); FORCS Co., LTD 157

158 OZ API Developer's Guide (for Java) Constructor Summary TaskHolidayInfo(String name) Method Summary String getname() void setbaseday(string pattern) String getbaseday() void settype(string type) String gettype() void setstart(int start) int getstart() void setend(int end) void getend() void read(ozdatainputstream in) void write(ozdataoutputstream out) Constructor Detail public TaskHolidayInfo(String name) throws SchedulerException name : ";". Method Detail getname 158 FORCS Co., LTD

159 public String getname(). setbaseday public void setbaseday(string pattern) throws SchedulerException. pattern : yyyy-mm-dd : yyyy-mm-01 : 1 yyyy : : getbaseday public String getbaseday(). settype public void settype(string type) throws SchedulerException,. type, solar : lunar : : solar, lunar solar. (solar, lunar ) gettype public String gettype() (, ). setstart public void setstart(int start) "baseday". start FORCS Co., LTD 159

160 OZ API Developer's Guide (for Java) getstart public int getstart() "baseday". setend public void setend(int end) "baseday". end getend public void getend() "baseday". read public void read(ozdatainputstream in) throws IOException EM InputStream. in OZDataInputStream write public void write(ozdataoutputstream out) throws IOException EM OutputStream. out OZDataOutputStream Sample : SchedulerTaskHoliday.java package sample; import java.util.*; import oz.util.ozmap; import oz.framework.api.*; import oz.scheduler.holiday.*; public class SchedulerTaskHoliday { 160 FORCS Co., LTD

161 public static void main(string[] args) { String IP = " "; //scheduler server ip int PORT = 9521; //scheduler server port Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); //TaskHolidayInfo. OZMap infomap = scheduler.gettaskholidayinfolist(); Iterator set = infomap.keys(); while(set.hasnext()) { String key = (String)set.next(); TaskHolidayInfo info = (TaskHolidayInfo)infoMap.get(key); System.out.println(info.toString()); //TaskHolidayInfo. TaskHolidayInfo info = new TaskHolidayInfo(""); info.setbaseday("yyyy-07-01"); info.settype("solar"); info.setstart(0); info.setend(0); scheduler.addtaskholidayinfo(info); //TaskHolidayInfo. info.setbaseday("yyyy-07-02"); scheduler.modifytaskholidayinfo("",info); //TaskHolidayInfo. scheduler.deletetaskholidayinfo(""); // TaskHoliday. //(.) scheduler.savetaskholiday(); catch(exception e) { e.printstacktrace(); FORCS Co., LTD 161

162 OZ API Developer's Guide (for Java) : Scheduler Info Properties {"task_holiday", " ; ". (ex : {"task_holiday", ";Group1") 162 FORCS Co., LTD

163 Constructor Summary TaskHolidayGroupInfo(String name) Method Summary String getname() void addreference(string name) void addreferences(string[] ref) String[] getreferences() void removereference(string name) void removereferences(string[] name) void removeallref() void read(ozdatainputstream in) void write(ozdataoutputstream out) Constructor Detail public TaskHolidayGroupInfo(String name) throws SchedulerException name : ";". Method Detail getname public String getname(). FORCS Co., LTD 163

164 OZ API Developer's Guide (for Java) addreference public void addreference(string name).. name ( ) addreference public void removereferences(string[] names). names getreferences public string[] getreferences() Reference. removereference public void removereferences(string name). name removereferences public void removereferences(string[] name). name getstart public void removeallref(). read public void read(ozdatainputstream in) throws IOException EM InputStream. in OZDataInputStream 164 FORCS Co., LTD

165 write public void write(ozdataoutputstream out) throws IOException EM OutputStream. out OZDataOutputStream Sample : SchedulerTaskHoliday.java package sample; import java.util.*; import oz.util.ozmap; import oz.framework.api.*; import oz.scheduler.holiday.*; public class SchedulerTaskHoliday { public static void main(string[] args) { String IP = " "; //scheduler server ip int PORT = 9521; //scheduler server port Scheduler scheduler = null; try { scheduler = new Scheduler(IP, PORT); //TaskHolidayInfoGroup. OZMap ginfomap = scheduler.gettaskholidaygroupinfolist(); Iterator set1 = ginfomap.keys(); while(set1.hasnext()) { String key = (String)set1.next(); TaskHolidayGroupInfo ginfo = (TaskHolidayGroupInfo)gInfoMap.get(key); System.out.println(ginfo.toString()); //TaskHolidayGroupInfo. TaskHolidayGroupInfo ginfo = new TaskHolidayGroupInfo("group1"); ginfo.addreference(""); ginfo.addreference(""); ginfo.addreference("31 "); scheduler.addtaskholidaygroupinfo(ginfo); FORCS Co., LTD 165

166 OZ API Developer's Guide (for Java) //TaskHolidayGroupInfo. ginfo.addreference(""); scheduler.modifytaskholidaygroupinfo("group1", ginfo); //TaskHolidayGroupInfo. scheduler.deletetaskholidaygroupinfo("group1"); // TaskHoliday. //(.) scheduler.savetaskholiday(); catch(exception e) { e.printstacktrace(); : Scheduler Info Properties {"task_holiday", " ; ". (ex : {"task_holiday", ";Group1") 166 FORCS Co., LTD

167 API OZLauncherDll FORCS Co., LTD 167

168 OZ API Developer's Guide (for Java) OZLauncherDll. Function Summary void_stdcall SetPath(LPCTSTR strpath) void_stdcall SetCommand(LPCTSTR strcommand) BOOL_stdcall CreateOZViewer(LPCTSTR str_param, int n_type) void_stdcall Release() Function Detail SetPath void_stdcall SetPath(LPCTSTR strpath). strpath SetCommand void_stdcall SetCommand(LPCTSTR strcommand). strcommand Example SetCommand("/locale ko/kr /mode alone /slp true /launchstring"); CreateOZViewer BOOL_stdcall CreateOZViewer(LPCTSTR str_param, int n_type). true false. 168 FORCS Co., LTD

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

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

171 RDB Store DataAction RDB Store DataAction RDB Store DataAction FORCS Co., LTD 171

172 OZ API Developer's Guide (for Java) RDB DataAction. public interface IRDBDelegate extends IDelegate { public void init(string param) throws Exception; public void close(); public String insert(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception; public String update(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception; public String delete(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception; public String commit() throws Exception; public void rollback() throws Exception; public void setconnection(java.sql.connection con); :. 1. setconnection() 2. init() 3. insert(), update(), delete() 4. commit(), rollback() 5. close() 172 FORCS Co., LTD

173 DataAction DataAction. package com.forcs.sample.dataaction.rdb; import com.forcs.log4oz.ozlog; public class DelegateSample implements oz.udd.irdbdelegate, oz.udd.iloggerref { private OZLog cat; private java.sql.connection con; public DelegateSample() { public void init(string param) throws Exception { //. public void close() { //close. public String insert(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception { //insert. public String update(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception { //Update. public String delete(oz.framework.dac.ozdacitem dac, java.util.dictionary parameters) throws Exception { //Delete. public String commit() throws Exception { //commit. FORCS Co., LTD 173

174 OZ API Developer's Guide (for Java) public void rollback() throws Exception { //rollback. public void setconnection(java.sql.connection con) { this.con = con; public void setlogger(ozlog cat) { this.cat = cat; 174 FORCS Co., LTD

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

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

177 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 177

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

179 UDS getresultset. UDS Source UDS Main. 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 { // Resultset. // OZ. public void freeresultset(resultset rst){ // getresultset ResultSet. // ResultSet Close. public void close() { // UserDataSet. // DB Disconnection. FORCS Co., LTD 179

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

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

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

183 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 183

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

185 //. 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 185

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

187 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 187

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

189 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 189

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

209 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 209

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

211 #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 211

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

213 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 213

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

215 { 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 215

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

217 User Defined Log UDL UDL UDL FORCS Co., LTD 217

218 OZ API Developer's Guide (for Java) UDL(User Defined Log) DB. UDL. OZ Server OZ UDL 2. DB Alias Search Interface OZ DB POOL 3. OZLog, Connection 1. DB Alias Name OZ UDL 1. OZServer init 2. tracelog 218 FORCS Co., LTD

219 UDL. OZUserDefinedLogTarget oz.udl.ozuserdefinedlogtarget oz.udl.ozdmlogtarget oz.udl.ozrdblogtarget oz.udl.ozuserdefinedlogtarget oz.udl.ozmonitorlogtarget OZ UDL Target OZUserDefinedLogTar get OZDMLogTarget extends OZUserDefinedLogTar get IP Address HttpRequest HttpServlet UserID ODIName DataSetName DataStoreName OZParam IP HttpRequest HttpServlet ID : UserID (" "). ODI Hash FORCS Co., LTD 219

220 OZ API Developer's Guide (for Java) OZRDBLogTarget extends OZDMLogTarget OZMonitorLogTarget extends OZUserDefinedLogTar get DBAlias ExecuteQuery PreparedQueryV alue QueryState QueryExecuteTi me isprepared CRUDFlagName MARK ThreadID Time Free Memory Total Memory Service Code Service Status ODI DB :. (select/insert/update/delete) (start/end) ID ( : ms) : Millisecond. ( : byte) ( : byte) MARK "end" "start" -1. ". ". MARK "end" "start" -1. "9001", "9002". 220 FORCS Co., LTD

221 Service Param DB SessionID Execute Time : MARK "end" "start" -1. DBMS ID : MARK "end" "start" -1. : MARK "end" "start" -1. OZ UDL OZUserDefinedLogger OZ UDL oz.udl.ozuserdefinedlogger. init public void init(oz.framework.db.ozconnection ozconn, com.forcs.log4oz.ozlog cat) throws OZUserDefinedLogException. ozconn cat DB DB tracelog public void tracelog(oz.udl.ozuserdefinedlogtarget target, oz.framework.db.ozconnection ozconn, com.forcs.log4oz.ozlog cat) throws OZUserDefinedLogException. target ozconn DB DB FORCS Co., LTD 221

222 OZ API Developer's Guide (for Java) cat getozdbalias return public java.lang.string getozdbalias() DB. DB OZUserDefinedLogTarget OZ UDL. getipaddress return public String getipaddress() IP IP gethttprequest return public HttpServletRequest gethttprequest() HttpRequest. HttpRequest : null. gethttpservlet return public HttpServlet gethttpservlet() HttpServlet. HttpServlet : null. getuserid return public String getuserid() ID ID 222 FORCS Co., LTD

223 OZDMLogTarget OZ UDL. getodiname return public java.lang.string getodiname() ODI. ODI getdatasetname return public java.lang.string getdatasetname(). getdatastorename return public java.lang.string getdatastorename(). getozparam return public java.util.hashmap getozparam() HashMap. key Value OZRDBLogTarget OZ UDL RDB. getdbalias return public String getdbalias() ODI DB. DB :. getdbexecutequery FORCS Co., LTD 223

224 OZ API Developer's Guide (for Java) return public String getdbexecutequery(). getpreparedqueryvalue return public Vector getpreparedqueryvalue(). ( ) getexecutequerystate return public String getexecutequerystate(). true flase getqueryexecutetime return public long getqueryexecutetime(). isprepared public String getexecutequerystate(). return true flase getcrudflagname public String getcrudflagname(). return select insert update delete Select Insert Update Delete 224 FORCS Co., LTD

225 OZDMLogTarget OZ UDL. getmark public string getmark(). return start end getthreadid return public integer getthreadid() ID. ID getservicetime return public long getservicetime(). ( : ms) : Millisecond. getfreememory return public long getfreememory(). ( : byte) gettotalmemory return public long gettotalmemory() JVM. ( : byte) getservicecode public integer getservicecode(). FORCS Co., LTD 225

226 OZ API Developer's Guide (for Java) return MARK "end" "start" -1. ". ". getservicestatus return public integer getservicestatus(). : MARK "end" "start" getserviceparameter return public string getserviceparameter(). : MARK "end" "start" -1. getdbsessionid return public string getdbsessionid() DBMS ID. : MARK "end" "start" -1. DBMS ID getexecutetime return public string getexecutetime(). ( : ms) : MARK "end" "start" FORCS Co., LTD

227 UDL. - UDL : OZ_HOME/lib/ozudl.jar - UDL : OZ_HOME/conf/ozudl.properties - ozudl.jar CLASSPATH. - udlmngr.properties UDL. # # configuraion of OZ User Defined log # # OZ_USER_DEFINED_LOG.Active=true OZ_USER_DEFINED_LOG.Class=oz.udl.UDL OZ_UDL_MONITOR.Active= true OZ_UDL_MONITOR.Class=oz.udl.UDL ozudl.properties UDL. OZ_USER_DEFINED_LOG.Active=true OZ_UDL_MONITOR.Active= true UDL. OZ_USER_DEFINED_LOG.Class=oz.udl.UDL FORCS Co., LTD 227

228 OZ API Developer's Guide (for Java) OZ_UDL_MONITOR.Class=oz.udl.UDL ex) OZ_USER_DEFINED_LOG.Class=oz.udl.file.OZUserDefinedLogger OZ_UDL_MONITOR.Class=oz.udl.db.OZMonitorLogForDB UDL 1 - UDL. UDL. java oz.udl.file.ozuserdefinedloggerforfile "ozudl.jar". package oz.udl.file; import java.io.*; import java.util.*; import org.apache.log4j.*; import javax.servlet.http.*; import oz.udl.*; import oz.framework.db.*; import com.forcs.log4oz.ozlog; import oz.framework.dac.ozdacdata; public class OZUserDefinedLoggerForFile implements OZUserDefinedLogger{ Category logger = null; private final static String ROLLING_FILE_APPENDER = "RollingAppender"; private final static String DAILY_ROLLING_FILE_APPENDER = "DailyRollingAppender"; private String logpath; private String layouts; private String AppenderType; private String filesize; private String backupindex; private String dailytype; 228 FORCS Co., LTD

229 public OZUserDefinedLoggerForFile() { /** * ozconn OZConnection cat OZLog trace OZUserDefinedLogException */ public void init(ozconnection ozconn, OZLog cat) throws OZUserDefinedLogException { try { load(cat); setappender(cat); catch(exception ex){ if (logger!= null) { logger.error(ex.getmessage(), ex); cat.error(ex.getmessage(), ex); throw new OZUserDefinedLogException(ex.getMessage()); private void load(ozlog cat) { Properties props = new Properties(); FileInputStream fis = null; try { fis = new FileInputStream("udl_file.properties"); props.load(fis); logpath=props.getproperty("logpath"); layouts=props.getproperty("layout"); AppenderType=props.getProperty("AppenderType"); filesize=props.getproperty("filesize"); backupindex=props.getproperty("backupindex"); dailytype=props.getproperty("dailytype"); catch(exception ex){ cat.error(ex.getmessage(), ex); finally{ if (fis!= null) try { fis.close(); catch(exception ex1){ private void setappender(ozlog cat) throws Exception { PatternLayout layout = new PatternLayout(layoutS); FORCS Co., LTD 229

230 OZ API Developer's Guide (for Java) if (ROLLING_FILE_APPENDER.equals(AppenderType)) { logpath, true); RollingFileAppender appender = new RollingFileAppender(layout, appender.setmaxfilesize(filesize); try { appender.setmaxbackupindex(integer.parseint(backupindex)); catch(exception ex){ appender.setmaxbackupindex(5); logger = Category.getInstance("oz.udl.file"); logger.setpriority(priority.debug); logger.addappender(appender); logger.debug("start..."); cat.debug("user db logger init..."); // trace else if (DAILY_ROLLING_FILE_APPENDER.equals(AppenderType)) { String datepattern = "'.'"+dailytype; DailyRollingFileAppender appender = new DailyRollingFileAppender(); appender.setdatepattern(datepattern); appender.setlayout(layout); appender.setfile(logpath,true); /** * trace target target OZUserDefinedLogTarget ozconn OZConnection cat OZLog ( trace param )cat.debug(str);) OZUserDBLogException */ public void tracelog(ozuserdefinedlogtarget target, OZConnection ozconn, OZLog cat) throws OZUserDefinedLogException { StringBuffer sb = new StringBuffer(); try { // OZRDBLogTarget casting. OZRDBLogTarget ref = (OZRDBLogTarget)target; String dbalias = (ref.getdbalias() == null) 230 FORCS Co., LTD

231 ? "" : ref.getdbalias(); sb.append("[db Alias="); sb.append(dbalias); sb.append("]"); String ipaddress = (ref.getipaddress() == null)? "" : ref.getipaddress(); sb.append("[ip Address="); sb.append(ipaddress); sb.append("]"); String userid = (ref.getuserid() == null)? "" : ref.getuserid(); sb.append("[userid="); sb.append(userid); sb.append("]"); HttpServletRequest request = ref.gethttprequest(); if(request!= null){ sb.append("[request Parameter="); Enumeration en = request.getparameternames(); while(en.hasmoreelements()){ String key = (String)en.nextElement(); String value = request.getparameter(key); sb.append("("); sb.append(key + "," + value); sb.append(")"); sb.append("]"); HttpSession session = request.getsession(false); if(session!= null){ sb.append("[session Attribute="); en = session.getattributenames(); while(en.hasmoreelements()){ String key = (String)en.nextElement(); sb.append("("); sb.append(key); sb.append(","); sb.append(session.getattribute(key)); sb.append(")"); sb.append("]"); FORCS Co., LTD 231

232 OZ API Developer's Guide (for Java) String crudflagname = (ref.getcrudflagname() == null)? "" : ref.getcrudflagname(); sb.append("[crudtype="); sb.append(crudflagname); sb.append("]"); sb.append("[isprepared="); sb.append(ref.isprepared()); sb.append("]"); if(ref.getpreparedqueryvalue()!= null){ sb.append("[querypreparedvalue="); Vector vec = ref.getpreparedqueryvalue(); if (crudflagname.equals("select")) { for (int i = 0; i < vec.size(); i++) { sb.append(vec.elementat(i)); else { for (int i = 0; i < vec.size(); i++) { OZDACData data = (OZDACData)vec.elementAt(i); sb.append(data.tostringdata()); sb.append(";"); sb.append("]"); String query = (ref.getdbexecutequery() == null)? "" : ref.getdbexecutequery(); sb.append("[query="); sb.append(query); sb.append("]"); long queryexec = ref.getqueryexecutetime(); sb.append("[query exec="); sb.append(queryexec); sb.append("]"); String querystate = (ref.getexecutequerystate() == null)? "" : ref.getexecutequerystate(); sb.append("[querystate="); sb.append(querystate); sb.append("]"); String odiname = (ref.getodiname() == null)? "" : ref.getodiname(); sb.append("[odiname="); 232 FORCS Co., LTD

233 sb.append(odiname); sb.append("]"); String datasetname = (ref.getdatasetname() == null)? "" : ref.getdatasetname(); sb.append("[datasetname="); sb.append(datasetname); sb.append("]"); String datastorename = (ref.getdatastorename() == null)? "" : ref.getdatastorename(); sb.append("[datastorename="); sb.append(datastorename); sb.append("]"); logger.info(sb.tostring()); catch(exception ex){ logger.error(ex.getmessage(), ex); cat.error(ex.getmessage(),ex); throw new OZUserDefinedLogException(ex.getMessage()); /** * UDL DB OZ Server Pool alias String */ public String getozdbalias() { return ""; ozudl.jar \lib OZ_HOME/bin/ozcntrl.bat. rem rem User Defined Log Class rem set OZLIB=%OZLIB%;%OZLIBALL%\ozudl.jar UDL OZ_HOME/conf/uslmngr.properties. FORCS Co., LTD 233

234 OZ API Developer's Guide (for Java) # # configuraion of OZ User Defined log # OZ_USER_DEFINED_LOG.Active=true OZ_USER_DEFINED_LOG.Class=oz.udl.file.OZUserDefinedLoggerForFile \bin "udl_file.properties". logpath=c:/program Files/Forcs/OZ XStudio/OZ Server 5.0/logs/UDL.log layout=%d{yyyy-mm-dd HH:mm:ss.SSS [%-5p] %C{1.%M - %m%n AppenderType=RollingAppender filesize=100kb backupindex=5 #AppenderType=DailyRollingAppender #dailytype=yyyy-mm-dd : "logpath" "\" "/"... [Data Action]. 234 FORCS Co., LTD

235 /log "UDL.log". UDL.log ODI. [INFO ] OZUserDefinedLoggerForFile.traceLog - [DB Alias=qa_ms][IP Address= ][UserID=admin][CRUDType=select][isPrepared=true][QueryP reparedvalue=][query=select * from REQ397][Query exec=16][querystate=true][odiname=/dataaction.odi][datasetname=sample][da tastorename=db] [INFO ] OZUserDefinedLoggerForFile.traceLog - [DB Alias=qa_ms][IP Address= ][UserID=admin][CRUDType=insert][isPrepared=true][QueryP reparedvalue=4;; ;][Query=insert into REQ397 (id,name,address) values (?,?,?)][Query exec=16][querystate=true] [ODIName=/DataAction.odi][DataSetName=Sample][DataStoreName=DB] UDL 2 - UDL. UDL. java oz.udl.file.ozuserdefinedloggerfordb "ozudl.jar" FORCS Co., LTD 235

236 OZ API Developer's Guide (for Java). ( db.properties DB "Sample" "OZDBHISTORY".) package oz.udl.db; import oz.udl.*; import oz.framework.db.*; import com.forcs.log4oz.ozlog; import oz.framework.dac.ozdacdata; import java.sql.*; import java.util.*; import java.text.*; import javax.servlet.http.*; public class OZUserDefinedLoggerForDB implements OZUserDefinedLogger{ // private final static String TABLENAME = "OZDBHISTORY"; private final static String QUERY = "insert into "+TABLENAME + " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; public OZUserDefinedLoggerForDB(){ /** * OZUserDefinedLogException */ public void init(ozconnection ozconn, OZLog cat) throws OZUserDefinedLogException{ try{ Connection conn = ozconn.getconnection(); if(!isexiststable(conn, TABLENAME)){ String createquery = "create table "+TABLENAME+" ( " + "TIME_ID varchar(255) NOT NULL, "+ "DB_ALIAS varchar(128) NOT NULL, "+ "IP varchar(27) NULL, "+ "USERID varchar(255) NULL, "+ "CRUDNAME varchar(6) NULL, "+ "ISPrepared varchar(5) NULL, "+ "SessionInfo text NULL, "+ "preparedvalue text NULL, "+ "Query text NULL, "+ 236 FORCS Co., LTD

237 "exe_time int NOT NULL, "+ "querystate varchar(255) NOT NULL, "+ "ODINAME varchar(255) NOT NULL, "+ "DataSetName varchar(255) NOT NULL, "+ "DataStoreName varchar(255) NOT NULL "+ " ) "; PreparedStatement pstmt = conn.preparestatement(createquery); pstmt.executeupdate(); createquery = "CREATE INDEX " + TABLENAME + "_idx_time_id ON " + TABLENAME + " (TIME_ID)"; pstmt.close(); pstmt = conn.preparestatement(createquery); pstmt.executeupdate(); pstmt.close(); catch(exception ex){ cat.error(ex.getmessage(), ex); throw new OZUserDefinedLogException(ex.getMessage()); /** * trace target target OZUserDefinedLogTarget ozconn OZConnection cat OZLog ( trace param )cat.debug(str);) OZUserDefinedLogException */ public void tracelog(ozuserdefinedlogtarget target, OZConnection ozconn, OZLog cat) throws OZUserDefinedLogException{ try{ OZRDBLogTarget ref = (OZRDBLogTarget)target; Connection conn = ozconn.getconnection(); PreparedStatement pstmt = conn.preparestatement(query); pstmt.setstring(1, getdatetime()); String dbalias = (ref.getdbalias() == null)? "" : ref.getdbalias(); pstmt.setstring(2, dbalias); pstmt.setstring(3, ref.getipaddress()); String userid = (ref.getuserid() == null)? "" : ref.getuserid(); FORCS Co., LTD 237

238 OZ API Developer's Guide (for Java) pstmt.setstring(4, userid); String crudflagname = (ref.getcrudflagname() == null)? "" : ref.getcrudflagname(); pstmt.setstring(5, crudflagname); pstmt.setstring(6, ref.isprepared()+""); StringBuffer sb = new StringBuffer(); HttpServletRequest request = ref.gethttprequest(); if (request!= null) { sb.append("[request Parameter="); Enumeration en = request.getparameternames(); while(en.hasmoreelements()) { String key = (String)en.nextElement(); String value = request.getparameter(key); sb.append("(");sb.append(key+","+value);sb.append(")"); sb.append("]"); HttpSession session = request.getsession(false); if (session!= null) { sb.append("[session Attribute="); en = session.getattributenames(); while(en.hasmoreelements()) { String key = (String)en.nextElement(); sb.append("("); sb.append(key); sb.append(","); sb.append(session.getattribute(key)); sb.append(")"); sb.append("]"); pstmt.setstring(7, sb.tostring()); else { pstmt.setstring(7, null); sb = new StringBuffer(); if(ref.getpreparedqueryvalue()!= null){ sb.append("[querypreparedvalue="); Vector vec = ref.getpreparedqueryvalue(); if (crudflagname.equals("select")) { for (int i = 0; i < vec.size(); i++) { sb.append(vec.elementat(i)); 238 FORCS Co., LTD

239 else { for (int i = 0; i < vec.size(); i++) { OZDACData data = (OZDACData)vec.elementAt(i); sb.append(data.tostringdata()); sb.append(";"); sb.append("]"); pstmt.setstring(8, sb.tostring()); pstmt.setstring(9, ref.getdbexecutequery()); pstmt.setint(10, (int)ref.getqueryexecutetime()); pstmt.setstring(11, ref.getexecutequerystate()); pstmt.setstring(12, ref.getodiname()); pstmt.setstring(13, ref.getdatasetname()); pstmt.setstring(14, ref.getdatastorename()); pstmt.executeupdate(); pstmt.close(); catch(exception ex){ cat.error(ex.getmessage(), ex); throw new OZUserDefinedLogException(ex.getMessage()); /** * UDL DB OZ Server Pool alias String */ public String getozdbalias(){ return "Sample"; private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); /** * String */ private String getdatetime() { return sdf.format(new java.util.date(system.currenttimemillis())); FORCS Co., LTD 239

240 OZ API Developer's Guide (for Java) /** * tablename String SQLException boolean */ private boolean isexiststable(connection conn, String tablename) throws SQLException { DatabaseMetaData meta = null; ResultSet rs = null; try { ////////////////;;///////////// if (conn!= null) { meta = conn.getmetadata(); else { throw new SQLException("Connection is null"); String[] tmptype = {"TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM"; rs = meta.gettables(null, null, null, tmptype); while (rs.next()) { if (rs.getstring(3).equals(tablename)) { return true; catch (SQLException sqlex) { throw sqlex; finally { if (rs!= null) rs.close(); rs = null; meta = null; return false; ozudl.jar \lib OZ_HOME/bin/ozcntrl.bat 240 FORCS Co., LTD

241 . rem rem User Defined Log Class rem set OZLIB=%OZLIB%;%OZLIBALL%\ozudl.jar UDL OZ_HOME/conf/uslmngr.properties. # # configuraion of OZ User Defined log # OZ_USER_DEFINED_LOG.Active=true OZ_USER_DEFINED_LOG.Class=oz.udl.db.OZUserDefinedLoggerForFile OZ_HOME/conf/db.properties oz.udl.db.ozuserdefinedloggerfordb. # # Sample # Sample.vendor=MSSQL Sample.serverAddress= Sample.user=user Sample.password=userpw Sample.portNo=1433 Sample.dbName=DBName Sample.maxconns=20 Sample.initconns=5 Sample.timeout=5 Sample.doConnectionCheck=false.. FORCS Co., LTD 241

242 OZ API Developer's Guide (for Java) [Data Action]. ODI. UDL 3 - OZ UDL monitor.log. 242 FORCS Co., LTD

243 UDL monitor.log. java oz.udl.db.ozuserdefinedmonitorlogger "ozudl.jar". ( db.properties DB " Sample" "OZ_MONITOR_JAVA".) package oz.udl.db; import oz.udl.*; import oz.framework.db.*; import com.forcs.log4oz.ozlog; import oz.framework.dac.ozdacdata; import java.sql.*; import java.util.*; import java.text.*; import javax.servlet.http.*; // public class OZUserDefinedMonitorLogger implements OZUserDefinedLogger { private final static String TABLENAME = "OZ_MONITOR_JAVA"; private final static String QUERY = "insert into "+TABLENAME + " values (?,?,?,?,?,?,?,?,?,?,?,?) "; public OZUserDefinedMonitorLogger(){ /** * OZUserDefinedLogException */ public void init(ozconnection ozconn, OZLog cat) throws OZUserDefinedLogException{ try{ Connection conn = ozconn.getconnection(); if(!isexiststable(conn, TABLENAME)){ String createquery = "create table "+TABLENAME+" ( " + "MARK varchar(5) NOT NULL, " + "THREAD_ID int NOT NULL, " + "SERVICE_TIME bigint NOT NULL, " + "FREE_MEMORY bigint NULL, " + FORCS Co., LTD 243

244 OZ API Developer's Guide (for Java) "TOTAL_MEMORY bigint NULL, " + "SERVICE_CODE smallint NULL, " + "SERVICE_STATUS smallint NULL, " + "SERVICE_PARAMETERS text NULL, " + "DB_SESSION_ID varchar(255) NULL, " + "EXECUTION_TIME bigint NULL, " + "CLIENT_IP varchar(50) NULL, " + "SESSION_INFO text NULL ) "; PreparedStatement pstmt = conn.preparestatement(createquery); pstmt.executeupdate(); ON " createquery = "CREATE INDEX " + TABLENAME + "_idx_service_time_id + TABLENAME + " (SERVICE_TIME)"; pstmt.close(); pstmt = conn.preparestatement(createquery); pstmt.executeupdate(); pstmt.close(); catch(exception ex){ cat.error(ex.getmessage(), ex); throw new OZUserDefinedLogException(ex.getMessage()); /** * target OZUserDefinedLogTarget ozconn OZConnection cat OZLog ( trace param )cat.debug(str);) OZUserDefinedLogException */ public void tracelog(ozuserdefinedlogtarget target, OZConnection ozconn, OZLog cat) throws OZUserDefinedLogException{ try{ OZMonitorLogTarget ref = (OZMonitorLogTarget)target; Connection conn = ozconn.getconnection(); PreparedStatement pstmt = conn.preparestatement(query); pstmt.setstring(1, ref.getmark()); pstmt.setint(2, ref.getthreadid()); pstmt.setlong(3, ref.getservicetime()); pstmt.setlong(4, ref.getfreememory()); 244 FORCS Co., LTD

245 pstmt.setlong(5, ref.gettotalmemory()); pstmt.setint(6, ref.getservicecode()); pstmt.setint(7, ref.getservicestatus()); pstmt.setstring(8, ref.getserviceparameter()); pstmt.setstring(9, ref.getdbsessionid()); pstmt.setlong(10, ref.getexecutetime()); pstmt.setstring(11, ref.getipaddress()); StringBuffer sb = new StringBuffer(); HttpServletRequest request = ref.gethttprequest(); if (request!= null) { sb.append("[request Parameter="); Enumeration en = request.getparameternames(); while(en.hasmoreelements()) { String key = (String)en.nextElement(); String value = request.getparameter(key); sb.append("(");sb.append(key+","+value);sb.append(")"); sb.append("]"); HttpSession session = request.getsession(false); if (session!= null) { sb.append("[session Attribute="); en = session.getattributenames(); while(en.hasmoreelements()) { String key = (String)en.nextElement(); sb.append("("); sb.append(key); sb.append(","); sb.append(session.getattribute(key)); sb.append(")"); sb.append("]"); pstmt.setstring(12, sb.tostring()); else { pstmt.setstring(12, null); pstmt.executeupdate(); pstmt.close(); catch(exception ex){ cat.error(ex.getmessage(), ex); throw new OZUserDefinedLogException(ex.getMessage()); FORCS Co., LTD 245

246 OZ API Developer's Guide (for Java) /** * UDL DB OZ Server Pool alias String */ public String getozdbalias(){ return "Sample"; private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); /** * String */ private String getdatetime() { return sdf.format(new java.util.date(system.currenttimemillis())); /** * tablename String SQLException boolean */ private boolean isexiststable(connection conn, String tablename) throws SQLException { DatabaseMetaData meta = null; ResultSet rs = null; try { if (conn!= null) { meta = conn.getmetadata(); else { throw new SQLException("Connection is null"); String[] tmptype = {"TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", "LOCAL TEMPORARY", "ALIAS", "SYNONYM"; rs = meta.gettables(null, null, null, tmptype); while (rs.next()) { 246 FORCS Co., LTD

247 if (rs.getstring(3).equals(tablename)) { return true; catch (SQLException sqlex) { throw sqlex; finally { if (rs!= null) rs.close(); rs = null; meta = null; return false; ozudl.jar \lib OZ_HOME/bin/ozcntrl.bat. rem rem User Defined Log Class rem set OZLIB=%OZLIB%;%OZLIBALL%\ozudl.jar UDL OZ_HOME/conf/uslmngr.properties. # # configuraion of OZ User Defined log # OZ_UDL_MONITOR.Active=true OZ_UDL_MONITOR.Class=oz.udl.db.OZUserDefinedMonitorLogger db.properties oz.udl.db.ozuserdefinedloggerfordb. # # Sample # Sample.vendor=MSSQL Sample.serverAddress= Sample.user=user FORCS Co., LTD 247

248 OZ API Developer's Guide (for Java) Sample.password=userpw Sample.portNo=1433 Sample.dbName=DBName Sample.maxconns=20 Sample.initconns=5 Sample.timeout=5 Sample.doConnectionCheck=false.. /log/monitor.log IP. start null null null null null null end item name;car.odi,item type;10000,category name; / start null null null null null null end item id; IP. 248 FORCS Co., LTD

249 Interface Repository Class RepositoryEx FORCS Co., LTD 249

250 OZ API Developer's Guide (for Java). Interface Summary // : oz.framework.repositoryex - public interface IOZRepository - public interface IOZRepositoryCategory - public interface IOZRepositoryItem - public interface IOZRepositoryItemHistory - public interface IOZRepositoryGroup - public interface IOZRepositoryUser - public interface IOZRepositoryMultiLoginUser Exception - public class OZRepositoryException extends Exception // : oz.framework.repositoryex.auth - public interface IOZRepositoryAuthGroupCategory - public interface IOZRepositoryAuthGroupItem - public interface IOZRepositoryAuthUserCategory - public interface IOZRepositoryAuthUserItem // : oz.framework.repositoryex.info (bean) 250 FORCS Co., LTD

251 - public interface IOZCategoryInfo - public interface IOZItemInfo - public interface IOZHistoryInfo - public interface IOZGroupInfo - public interface IOZUserInfo - public interface IOZLoginInfo (bean) - public interface IOZCategoryInfoList - public interface IOZItemInfoList - public interface IOZHistoryInfoList - public interface IOZGroupInfoList - public interface IOZUserInfoList Interface Method Summary // IOZRepository void setproperty(sortproperties prop) throws OZRepositoryException int getrepositoryversion() void openrepository() throws OZRepositoryException void closerepository() throws OZRepositoryException Object checkrepositorylogin(string username, String password, IOZLoginInfo logininfo, HttpServletRequest request, HttpServlet servlet) throws OZRepositoryException void updatesesssionstate(object sessionid, int type) throws OZRepositoryException boolean repositorylogout(object sessionid, String username, IOZLoginInfo logininfo, HttpServletRequest request, HttpServlet servlet) throws OZRepositoryException IOZRepositoryCategory getrepositorycategory() throws OZRepositoryException IOZRepositoryItem getrepositoryitem() throws OZRepositoryException IOZRepositoryItemHistory getrepositoryitemhistory() throws OZRepositoryException FORCS Co., LTD 251

252 OZ API Developer's Guide (for Java) IOZRepositoryGroup getrepositorygroup() throws OZRepositoryException IOZRepositoryUser getrepositoryuser() throws OZRepositoryException IOZRepositoryMultiLoginUser getrepositorymultiloginuser() throws OZRepositoryException IOZRepositoryAuthGroupCategory getrepositoryauthgroupcategory() throws OZRepositoryException IOZRepositoryAuthGroupItem getrepositoryauthgroupitem() throws OZRepositoryException IOZRepositoryAuthUserCategory getrepositoryauthusercategory() throws OZRepositoryException IOZRepositoryAuthUserItem getrepositoryauthuseritem() throws OZRepositoryException // IOZRepositoryCategory int getaccesstypecategory() IOZRepository getozrepository() throws OZRepositoryException String[] createitemincategory(object sessionid, String[] itemnames, String[] descs, String[] categoryids, InputStream[] item_ins, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException String[] createcategory(object sessionid, String[] categorynames, String[] pcategoryids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException String modifycategoryname(object sessionid, String categoryid, String new_categoryname, String comment) throws OZRepositoryException boolean[] deletecategory(object sessionid, String[] categoryids, boolean[] isdestroys, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException boolean[] undeletecategory(object sessionid, String[] categoryids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException boolean hastheitemincategory(object sessionid, String itemid) throws OZRepositoryException int getitemcountincategory(object sessionid, String categoryid) throws OZRepositoryException 252 FORCS Co., LTD

253 IOZItemInfoList getitemlistincategory(object sessionid, String categoryid) throws OZRepositoryException IOZCategoryInfoList getcategorylistincategory(object sessionid, String categoryid) throws OZRepositoryException String getcategoryidofitem(object sessionid, String itemid) throws OZRepositoryException IOZCategoryInfo getcategoryinfo(object sessionid, String categoryid) throws OZRepositoryException IOZItemInfoList getdeleteditemlistincategory(object sessionid, String categoryid) throws OZRepositoryException boolean transferitem(object sessionid, String[] itemids, String target_categoryid) throws OZRepositoryException boolean transfercategory(object sessionid, String categoryid, String target_categoryid) throws OZRepositoryException // IOZRepositoryItem public int getaccesstypeitem() public IOZRepository getozrepository() throws OZRepositoryException public String[] createitem(object sessionid, String[] itemnames, String[] descs, InputStream[] item_ins, String comment, int[] errorcode, String[] errormsg) throws public String modifyitemname(object sessionid, String itemid, String new_itemname, String comment) throws OZRepositoryException public boolean[] deleteitem(object sessionid, String[] itemids, boolean[] isdestroys, String comment, int[] errorcode, String[] errormsg) throws public boolean[] undeleteitem(object sessionid, String[] itemids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException public boolean modifyitemdesc(object sessionid, String itemid, String desc) throws OZRepositoryException public IOZItemInfo getiteminfo(object sessionid, String itemid) throws OZRepositoryException public boolean hastheitem(object sessionid, String itemid) throws OZRepositoryException public InputStream[] getitems(object sessionid, String itemids[], int[] FORCS Co., LTD 253

254 OZ API Developer's Guide (for Java) errorcode, String[] errormsg) throws OZRepositoryException public InputStream[] getitems(object sessionid, String itemids[], long[] modifiedtimes, int[] errorcode, String[] errormsg) throws OZRepositoryException public InputStream[] checkoutitem(object sessionid, String itemids[], String[] localcheckoutfolders, long[] localfiletimes, int[] errorcode, String[] errormsg) throws public boolean[] checkinitem(object sessionid, String[] itemids, InputStream[] item_ins, String comment, boolean[] keepcheckout, int[] errorcode, String[] errormsg) throws public InputStream[] undocheckoutitem(object sessionid, String[] itemids, boolean[] isreplaces, int[] errorcode, String[] errormsg) throws OZRepositoryException public boolean[] ischeckoutuser(object sessionid, String[] itemids) throws OZRepositoryException // IOZRepositoryItemHistory public int getaccesstypeitemhistory() public IOZRepository getozrepository() throws OZRepositoryException public boolean rollbackitem(object sessionid, String itemid, int itemversion, String comment) throws OZRepositoryException public InputStream getitembyversion(object sessionid, String itemid, int version) throws OZRepositoryException public IOZHistoryInfoList gethistoryitemlist(object sessionid, String itemid) throws OZRepositoryException public IOZHistoryInfoList getdeletehistoryiteminfo(object sessionid, String itemid) throws OZRepositoryException public boolean removehistoryitem(object sessionid, String itemid, int itemversion) throws OZRepositoryException // IOZRepositoryGroup public int getaccesstypegroup() public IOZRepository getozrepository() throws OZRepositoryException public String creategroup(object sessionid, String gname, String pgroupid, String desc) throws OZRepositoryException 254 FORCS Co., LTD

255 public String modifygroupname(object sessionid, String groupid, String gname) throws OZRepositoryException public boolean modifygroupdesc(object sessionid, String groupid, String desc) throws OZRepositoryException public boolean deletegroup(object sessionid, String groupid) throws OZRepositoryException public String createuseringroup(object sessionid, String username, String password, String groupid, String desc) throws OZRepositoryException public IOZUserInfoList getuserinfolistingroup(object sessionid, String groupid) throws OZRepositoryException public IOZGroupInfo getgroupinfo(object sessionid, String groupid) throws OZRepositoryException public IOZGroupInfoList getsubgroupinfolist(object sessionid, String groupid) throws OZRepositoryException public IOZGroupInfo getparentgroupinfo(object sessionid, String groupid) throws OZRepositoryException public IOZGroupInfo getgroupidofuser(object sessionid, String userid) throws OZRepositoryException public boolean addgroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException public boolean removegroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException public boolean isusergroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException public IOZUserInfoList getuseradminlistingroup(object sessionid, String groupid) throws OZRepositoryException public boolean transferuser(object sessionid, String userid, String target_groupid) throws OZRepositoryException public boolean transfergroup(object sessionid, String groupid, String target_groupid) throws OZRepositoryException // IOZRepositoryUser public int getaccesstypeuser() public IOZRepository getozrepository() throws OZRepositoryException public String createuser(object sessionid, String username, String FORCS Co., LTD 255

256 OZ API Developer's Guide (for Java) password, String desc) throws OZRepositoryException public String modifyusername(object sessionid, String userid, String username) throws OZRepositoryException public boolean modifyuserpassword(object sessionid, String userid, String old_password, String new_password) throws OZRepositoryException public boolean modifyuserdesc(object sessionid, String userid, String desc) throws OZRepositoryException public boolean deleteuser(object sessionid, String userid) throws OZRepositoryException public IOZUserInfo getuserinfo(object sessionid, String userid) throws OZRepositoryException public boolean checkuserpassword(object sessionid, String userid, String password) throws OZRepositoryException public IOZUserInfoList getuserinfolist(object sessionid) throws OZRepositoryException public boolean ischeckadmin(object sessionid, String userid) throws OZRepositoryException // IOZRepositoryMultiLoginUser public int getaccesstypeuser() public IOZRepository getozrepository() throws OZRepositoryException public String createuser(object sessionid, String username, String password, String desc) throws OZRepositoryException public String modifyusername(object sessionid, String userid, String username) throws OZRepositoryException public boolean modifyuserpassword(object sessionid, String userid, String old_password, String new_password) throws OZRepositoryException public boolean modifyuserdesc(object sessionid, String userid, String desc) throws OZRepositoryException public boolean deleteuser(object sessionid, String userid) throws OZRepositoryException public IOZUserInfo getuserinfo(object sessionid, String userid) throws OZRepositoryException 256 FORCS Co., LTD

257 public boolean checkuserpassword(object sessionid, String userid, String password) throws OZRepositoryException public IOZUserInfoList getuserinfolist(object sessionid) throws OZRepositoryException public boolean ischeckadmin(object sessionid, String userid) throws OZRepositoryException // IOZRepositoryAuthGroupCategory public int getaccesstypeauthgroupcategory() public IOZRepository getozrepository() throws OZRepositoryException public boolean modifycategorygroupauth(object sessionid, String categoryid, String groupid, int perm) throws OZRepositoryException public int getgroupauthtocategory(object sessionid, String categoryid, String groupid) throws OZRepositoryException public IOZGroupInfoList getgrouplistauthtocategory(object sessionid, String categoryid, int perm) throws OZRepositoryException public IOZItemInfoList getitemlistauthtogroupincategory(object sessionid, String groupid, String categoryid, int perm) throws OZRepositoryException public IOZCategoryInfoList getcategorylistauthtogroupincategory(object sessionid, String groupid, String categoryid, int perm) throws OZRepositoryException // IOZRepositoryAuthGroupItem public int getaccesstypeauthgroupitem() public IOZRepository getozrepository() throws OZRepositoryException public boolean modifyitemgroupauth(object sessionid, String groupid, String itemid, int perm) throws OZRepositoryException public int getgroupauthtoitem(object sessionid, String groupid, String itemid) throws OZRepositoryException public IOZGroupInfoList getgrouplistauthtoitem(object sessionid, String itemid, int perm) throws OZRepositoryException public IOZItemInfoList getitemlistauthtogroup(object sessionid, String groupid, int perm) throws OZRepositoryException FORCS Co., LTD 257

258 OZ API Developer's Guide (for Java) // IOZRepositoryAuthUserCategory public int getaccesstypeauthusercategory() public IOZRepository getozrepository() throws OZRepositoryException public boolean modifycategoryuserauth(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException public int getuserauthtocategory(object sessionid, String userid, String categoryid) throws OZRepositoryException public IOZUserInfoList getuserlistauthtocategory(object sessionid, String categoryid, int perm) throws OZRepositoryException public IOZItemInfoList getitemlistauthtouserincategory(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException public IOZCategoryInfoList getcategorylistauthtouserincategory(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException // IOZRepositoryAuthUserItem public int getaccesstypeauthuseritem() public IOZRepository getozrepository() throws OZRepositoryException public boolean modifyitemuserauth(object sessionid, String userid, String itemid, int perm) throws OZRepositoryException public int getuserauthtoitem(object sessionid, String userid, String itemid) throws OZRepositoryException public IOZUserInfoList getuserlistauthtoitem(object sessionid, String itemid, int perm) throws OZRepositoryException public IOZItemInfoList getitemlistauthtouser(object sessionid, String userid, int perm) throws OZRepositoryException Interface Method Detail // IOZRepository Interface Method Summary setproperty public void setproperty(sortproperties prop) throws OZRepositoryException 258 FORCS Co., LTD

259 . "repository.properties", Key. prop getrepositoryversion public int getrepositoryversion(). openrepository public void openrepository() throws OZRepositoryException. closerepository public void closerepository() throws OZRepositoryException. checkrepositorylogin public Object checkrepositorylogin(string username, String password, IOZLoginInfo logininfo, HttpServletRequest request, HttpServlet servlet) throws OZRepositoryException. username password iscallserver logininfo request servlet : IOZLoginInfo. HTTP Servelt Request HTTP Servlet updatesesssionstate public void updatesesssionstate(object sessionid, int type) throws OZRepositoryException FORCS Co., LTD 259

260 OZ API Developer's Guide (for Java). sessionid ID type 0 : DEFAULT 1 : BARE_SERVER 2 : FROM_SERVER repositorylogout public boolean repositorylogout(object sessionid, String username, IOZLoginInfo logininfo, HttpServletRequest request, HttpServlet servlet) throws OZRepositoryException ID,. sessionid ID username logininfo request servlet ( ) HTTP Servelt Request HTTP Servlet getrepositorycategory public IOZRepositoryCategory getrepositorycategory() throws OZRepositoryException. getrepositoryitem public IOZRepositoryItem getrepositoryitem() throws OZRepositoryException. getrepositoryitemhistory public IOZRepositoryItemHistory getrepositoryitemhistory() throws OZRepositoryException. getrepositorygroup 260 FORCS Co., LTD

261 public IOZRepositoryGroup getrepositorygroup() throws OZRepositoryException. getrepositoryuser public IOZRepositoryUser getrepositoryuser() throws OZRepositoryException. getrepositorymultiloginuser public IOZRepositoryMultiLoginUser getrepositorymultiloginuser() throws OZRepositoryException getrepositoryauthgroupcategory public IOZRepositoryAuthGroupCategory getrepositoryauthgroupcategory() throws OZRepositoryException getrepositoryauthgroupitem public IOZRepositoryAuthGroupItem getrepositoryauthgroupitem() throws OZRepositoryException getrepositoryauthusercategory public IOZRepositoryAuthUserCategory getrepositoryauthusercategory() throws OZRepositoryException getrepositoryauthuseritem public IOZRepositoryAuthUserItem getrepositoryauthuseritem() throws OZRepositoryException FORCS Co., LTD 261

262 OZ API Developer's Guide (for Java) - 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"); // IOZRepositoryCategory Interface Method Summary getaccesstypecategory public int getaccesstypecategory() 262 FORCS Co., LTD

263 . int ACCESS_CATEGORY_NOT = 0x int ACCESS_CREATEITEM_IN_CATEGORY = 0x int ACCESS_CREATE_CATEGORY = 0x int ACCESS_MODIFY_CATEGORY_NAME = 0x int ACCESS_DELETE_CATEGORY = 0x int ACCESS_UN_DELETE_CATEGORY = 0x int ACCESS_HAS_THE_ITEM_IN_CATEGORY = 0x int ACCESS_GET_ITEMCOUNT_IN_CATEGORY = 0x int ACCESS_GET_ITEMLIST_IN_CATEGORY = 0x int ACCESS_GET_CATEGORYID_OF_ITEM = 0x int ACCESS_GET_CATEGORY_INFO = 0x int ACCESS_GET_DELETED_ITEMLIST_IN_CATEGORY = 0x int ACCESS_GET_SEARCH_ITEMLIST_IN_CATEGORY = 0x int ACCESS_GET_CATEGORYLIST_IN_CATEGORY = 0x int ACCESS_TRANSFER_ITEM = 0x ; int ACCESS_TRANSFER_CATEGORY = 0x ; getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. createitemincategory public String[] createitemincategory(object sessionid, String[] itemnames, String[] descs, String[] categoryids, InputStream[] item_ins, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid itemname descs categoryids item_ins comment errorcode errormsg ID ID ID createcategory FORCS Co., LTD 263

264 OZ API Developer's Guide (for Java) public String[] createcategory(object sessionid, String[] categorynames, String[] pcategoryids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid categoryname pcategoryids comment errorcode errormsg ID ID modifycategoryname public String modifycategoryname(object sessionid, String categoryid, String new_categoryname, String comment) throws OZRepositoryException ID. sessionid ID categoryid ID new_categoryname comment deletecategory public boolean[] deletecategory(object sessionid, String[] categoryids, boolean[] isdestroys, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid categoryids isdestroys comment errorcode errormsg ID ID undeletecategory 264 FORCS Co., LTD

265 public boolean[] undeletecategory(object sessionid, String[] categoryids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException. : "isdestroys=false". sessionid ID categoryids comment errorcode errormsg ID hastheitemincategory public boolean hastheitemincategory(object sessionid, String itemid) throws OZRepositoryException. sessionid itemid ID ID getitemcountincategory public int getitemcountincategory(object sessionid, String categoryid) throws OZRepositoryException. sessionid categoryid ID ID getitemlistincategory public IOZItemInfoList getitemlistincategory(object sessionid, String categoryid) throws OZRepositoryException. sessionid categoryid ID ID getcategoryidofitem FORCS Co., LTD 265

266 OZ API Developer's Guide (for Java) public String getcategoryidofitem(object sessionid, String itemid) throws OZRepositoryException ID. sessionid itemid ID ID ID getcategoryinfo public IOZCategoryInfo getcategoryinfo(object sessionid, String categoryid) throws OZRepositoryException. sessionid categoryid ID ID getdeleteditemlistincategory public IOZItemInfoList getdeleteditemlistincategory(object sessionid, String categoryid) throws OZRepositoryException. : "isdestroys=false". sessionid ID categoryid ID transferitem public boolean transferitem(object sessionid, String[] itemids, String target_categoryid) throws OZRepositoryException. sessionid itemids ID ID target_categoryid ID transfercategory public boolean transfercategory(object sessionid, String categoryid, String target_categoryid) throws OZRepositoryException 266 FORCS Co., LTD

267 . sessionid itemids ID ID target_categoryid ID // IOZRepositoryItem Interface Method Summary getaccesstypeitem public int getaccesstypecategory(). int ACCESS_ITEM_NOT = 0x int ACCESS_CREATE_ITEM = 0x int ACCESS_MODIFY_ITEMNAME = 0x int ACCESS_DELETE_ITEM = 0x int ACCESS_UN_DELETE_ITEM = 0x int ACCESS_MODIFY_ITEM_DESC = 0x int ACCESS_HAS_THE_ITEM = 0x int ACCESS_GET_ITEM_INFO = 0x int ACCESS_GET_ITEMS_UNCONDITION = 0x int ACCESS_GET_ITEMS = 0x int ACCESS_CHECKOUT_ITEM = 0x int ACCESS_CHECKIN_ITEM = 0x int ACCESS_UNDO_CHECKOUT_ITEM = 0x int ACCESS_IS_CHECKOUT_USER = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. createitem public String[] createitem(object sessionid, String[] itemnames, String[] descs, InputStream[] item_ins, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid itemnames descs ID FORCS Co., LTD 267

268 OZ API Developer's Guide (for Java) item_ins comment errcodes errmsgs modifyitemname public String modifyitemname(object sessionid, String itemid, String new_itemname, String comment) throws OZRepositoryException ID ID. sessionid ID itemid ID new_itemname comment deleteitem public boolean[] deleteitem(object sessionid, String[] itemids, boolean[] isdestroys, String comment, int[] errorcode, String[] errormsg) throws. sessionid ID itemids isdestroys comment errcodes errmsgs ID undeleteitem public boolean[] undeleteitem(object sessionid, String[] itemids, String comment, int[] errorcode, String[] errormsg) throws OZRepositoryException. : "isdestroys=false". sessionid ID 268 FORCS Co., LTD

269 itemids comment errcodes errmsgs ID modifyitemdesc public boolean modifyitemdesc(object sessionid, String itemid, String desc) throws OZRepositoryException ID. sessionid ID itemid desc ID getiteminfo public IOZItemInfo getiteminfo(object sessionid, String itemid) throws OZRepositoryException ID. sessionid itemid ID ID hastheitem public boolean hastheitem(object sessionid, String itemid) throws OZRepositoryException. sessionid itemid ID ID getitems public InputStream[] getitems(object sessionid, String itemids[], int[] errorcode, String[] errormsg) throws OZRepositoryException public InputStream[] getitems(object sessionid, String itemids[], long[] modifiedtimes, int[] errorcode, String[] errormsg) throws OZRepositoryException FORCS Co., LTD 269

270 OZ API Developer's Guide (for Java). sessionid itemids modifiedtimes errcodes errmsgs ID ID checkoutitem public InputStream[] checkoutitem(object sessionid, String itemids[], String[] localcheckoutfolders, long[] localfiletimes, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid ID itemids localcheckout Folders localfiletimes errcodes errmsgs ID checkinitem public boolean[] checkinitem(object sessionid, String[] itemids, InputStream[] item_ins, String comment, boolean[] keepcheckout, int[] errorcode, String[] errormsg) throws OZRepositoryException ID. sessionid ID itemids item Streams comment keepcheckout errcodes errmsgs ID 270 FORCS Co., LTD

271 undocheckoutitem public InputStream[] undocheckoutitem(object sessionid, String[] itemids, boolean[] isreplaces, int[] errorcode, String[] errormsg) throws OZRepositoryException. sessionid itemids isreplaces errcodes errmsgs ID ID ischeckoutuser public boolean[] ischeckoutuser(object sessionid, String[] itemids) throws OZRepositoryException sessionid ID itemids ID // IOZRepositoryItemHistory getaccesstypeitemhistory public int getaccesstypeitemhistory(). int ACCESS_ITEM_HISTORY_NOT = 0x int ACCESS_ROLLBACK_ITEM = 0x int ACCESS_GET_ITEM_BY_VERSION = 0x int ACCESS_GET_HISTORY_ITEMLIST = 0x int ACCESS_GET_DELETE_HISTORY_ITEMLIST = 0x int ACCESS_REMOVE_HISTORY_ITEM = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. rollbackitem FORCS Co., LTD 271

272 OZ API Developer's Guide (for Java) public boolean rollbackitem(object sessionid, String itemid, int itemversion, String comment) throws OZRepositoryException. sessionid itemid itemversion comment ID ID getitembyversion public InputStream getitembyversion(object sessionid, String itemid, int version) throws OZRepositoryException ID. sessionid ID itemid version ID gethistoryitemlist public IOZHistoryInfoList gethistoryitemlist(object sessionid, String itemid) throws OZRepositoryException. sessionid ID itemids ID getdeletehistoryiteminfo public IOZHistoryInfoList getdeletehistoryiteminfo(object sessionid, String itemid) throws OZRepositoryException. : "isdestroys=false". sessionid ID itemids ID removehistoryitem 272 FORCS Co., LTD

273 public boolean removehistoryitem(object sessionid, String itemid, int itemversion) throws OZRepositoryException. sessionid itemid item version ID ID // IOZRepositoryGroup getaccesstypegroup public int getaccesstypegroup(). int ACCESS_GROUP_NOT = 0x int ACCESS_CREATE_GROUP = 0x int ACCESS_MODIFY_GROUP_NAME = 0x int ACCESS_MODIFY_GROUP_DESC = 0x int ACCESS_DELETE_GROUP = 0x int ACCESS_CREATE_UESR_IN_GROUP = 0x ACCESS_TRANSFER_USER = 0x int ACCESS_GET_USERINFOLIST_IN_GROUP = 0x int ACCESS_GET_GROUPINFO = 0x int ACCESS_GET_SUB_GROUPINFO_LIST = 0x int ACCESS_GET_PARENT_GROUPINFO = 0x int ACCESS_GET_GROUPID_OF_USER = 0x int ACCESS_ADD_GROUP_ADMIN = 0x int ACCESS_REMOVE_GROUP_ADMIN = 0x int ACCESS_IS_USER_GROUP_ADMIN = 0x int ACCESS_GET_USER_ADMINLIST_IN_GROUP = 0x int ACCESS_TRANSFER_GROUP = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. creategroup public String creategroup(object sessionid, String gname, String pgroupid, String desc) throws OZRepositoryException ID. FORCS Co., LTD 273

274 OZ API Developer's Guide (for Java) sessionid gname pgroupid desc ID ID modifygroupname public String modifygroupname(object sessionid, String groupid, String gname) throws OZRepositoryException ID ID. sessionid groupid gname ID ID modifygroupdesc public boolean modifygroupdesc(object sessionid, String groupid, String desc) throws OZRepositoryException ID. sessionid ID groupid desc ID deletegroup public boolean deletegroup(object sessionid, String groupid) throws OZRepositoryException ID. sessionid groupid ID ID createuseringroup public String createuseringroup(object sessionid, String username, String password, String groupid, String desc) throws OZRepositoryException ID ID. 274 FORCS Co., LTD

275 sessionid username password groupid desc ID ID getuserinfolistingroup public IOZUserInfoList getuserinfolistingroup(object sessionid, String groupid) throws OZRepositoryException ID. sessionid groupid ID ID getgroupinfo public IOZGroupInfo getgroupinfo(object sessionid, String groupid) throws OZRepositoryException ID. sessionid groupid ID ID getsubgroupinfolist public IOZGroupInfoList getsubgroupinfolist(object sessionid, String groupid) throws OZRepositoryException. sessionid groupid ID ID getparentgroupinfo public IOZGroupInfo getparentgroupinfo(object sessionid, String groupid) throws OZRepositoryException. sessionid ID groupid ID FORCS Co., LTD 275

276 OZ API Developer's Guide (for Java) getgroupidofuser public IOZGroupInfo getgroupidofuser(object sessionid, String userid) throws OZRepositoryException. sessionid ID userid ID addgroupadmin public boolean addgroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException. sessionid userid groupid ID ID ID removegroupadmin public boolean removegroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException. sessionid userid groupid ID ID ID isusergroupadmin public boolean isusergroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException ID. sessionid ID userid groupid ID ID getuseradminlistingroup 276 FORCS Co., LTD

277 public IOZUserInfoList getuseradminlistingroup(object sessionid, String groupid) throws OZRepositoryException. sessionid groupid ID ID transferuser public boolean transferuser(object sessionid, String userid, String target_groupid) throws OZRepositoryException. sessionid userid ID ID target_groupid ID transfergroup public boolean transfergroup(object sessionid, String groupid, String target_groupid) throws OZRepositoryException. sessionid userid ID ID target_groupid ID // IOZRepositoryUser getaccesstypeuser public int getaccesstypeuser(). int ACCESS_USER_NOT = 0x int ACCESS_CREATE_USER = 0x int ACCESS_MODIFY_USER_NAME = 0x int ACCESS_MODIFY_USER_PASSWORD = 0x int ACCESS_MODIFY_USER_DESC = 0x int ACCESS_DELETE_USER = 0x int ACCESS_GET_USERINFO = 0x int ACCESS_CHECK_USER_PASSWORD = 0x int ACCESS_GET_USERINFO_LIST = 0x int ACCESS_GET_IS_CHECK_ADMIN = 0x FORCS Co., LTD 277

278 OZ API Developer's Guide (for Java) getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. createuser public String createuser(object sessionid, String username, String password, String desc) throws OZRepositoryException ID. sessionid username password desc ID modifyusername public String modifyusername(object sessionid, String userid, String username) throws OZRepositoryException ID ID. sessionid ID userid username ID modifyuserpassword public boolean modifyuserpassword(object sessionid, String userid, String old_password, String new_password) throws OZRepositoryException. sessionid userid old_password new_password ID ID modifyuserdesc 278 FORCS Co., LTD

279 public boolean modifyuserdesc(object sessionid, String userid, String desc) throws OZRepositoryException ID. sessionid ID userid desc ID deleteuser public boolean deleteuser(object sessionid, String userid) throws OZRepositoryException ID. sessionid ID userid ID getuserinfo public IOZUserInfo getuserinfo(object sessionid, String userid) throws OZRepositoryException ID. sessionid userid ID ID checkuserpassword public boolean checkuserpassword(object sessionid, String userid, String password) throws OZRepositoryException. sessionid userid password ID ID getuserinfolist public IOZUserInfoList getuserinfolist(object sessionid) throws OZRepositoryException. FORCS Co., LTD 279

280 OZ API Developer's Guide (for Java) sessionid ID ischeckadmin public boolean ischeckadmin(object sessionid, String userid) throws OZRepositoryException ID. sessionid ID userid ID // IOZRepositoryMultiLoginUser getaccesstypemultiloginuser public int getaccesstypemultiloginuser(). int ACCESS_MULTILOGINUSER_NOT = 0x int ACCESS_DISABLE_USER_LOGIN = 0x int ACCESS_ENABLE_USER_LOGIN = 0x int ACCESS_IS_LOGIN_ENABLED = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. disableuserlogin public void disableuserlogin(object sessionid) throws OZRepositoryException ID. sessionid ID enableuserlogin public void enableuserlogin(object sessionid) throws OZRepositoryException ID. sessionid ID 280 FORCS Co., LTD

281 isloginenabled public boolean isloginenabled(object sessionid) throws OZRepositoryException ID. sessionid ID // IOZRepositoryAuthGroupCategory getaccesstypeauthgroupcategory public int getaccesstypeauthgroupcategory(). int ACCESS_TYPE_AUTH_GROUP_CATEGORY_NOT = 0x int ACCESS_TYPE_MODIFY_CATEGORY_GROUPAUTH = 0x int ACCESS_TYPE_GET_GROUPAUTH_TO_CATEGORY = 0x int ACCESS_TYPE_GET_GROUPLIST_AUTH_TO_CATEGORY = 0x int ACCESS_TYPE_GET_ITEMLIST_AUTH_TO_GROUP_IN_CATEGORY = 0x int ACCESS_TYPE_GET_CATEGORYLIST_AUTH_TO_GROUP_IN_CATEGORY = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. modifycategorygroupauth public boolean modifycategorygroupauth(object sessionid, String categoryid, String groupid, int perm) throws OZRepositoryException. sessionid ID categoryid groupid ID ID FORCS Co., LTD 281

282 OZ API Developer's Guide (for Java) perm 1 : VIEW 2 : READ 4 : WRITE : OR. getgroupauthtocategory public int getgroupauthtocategory(object sessionid, String categoryid, String groupid) throws OZRepositoryException. sessionid categoryid groupid ID ID ID getgrouplistauthtocategory public IOZGroupInfoList getgrouplistauthtocategory(object sessionid, String categoryid, int perm) throws OZRepositoryException ID perm. sessionid ID categoryid perm ID getitemlistauthtogroupincategory public IOZItemInfoList getitemlistauthtogroupincategory(object sessionid, String groupid, String categoryid, int perm) throws OZRepositoryException perm. sessionid ID groupid categoryid perm ID ID 282 FORCS Co., LTD

283 getcategorylistauthtogroupincategory public IOZCategoryInfoList getcategorylistauthtogroupincategory(object sessionid, String groupid, String categoryid, int perm) throws OZRepositoryException perm. sessionid ID groupid categoryid perm ID ID // IOZRepositoryAuthGroupItem getaccesstypeauthgroupitem public int getaccesstypeauthgroupitem(). int ACCESS_TYPE_AUTH_GROUP_ITEM_NOT = 0x int ACCESS_TYPE_MODIFY_ITEM_GROUPAUTH = 0x int ACCESS_TYPE_GET_GROUPAUTH_TO_ITEM = 0x int ACCESS_TYPE_GET_GROUPLIST_AUTH_TO_ITEM = 0x int ACCESS_TYPE_GET_ITEMLIST_AUTH_TO_GROUP = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. modifyitemgroupauth public boolean modifyitemgroupauth(object sessionid, String groupid, String itemid, int perm) throws OZRepositoryException ID ID. sessionid ID groupid itemid ID ID FORCS Co., LTD 283

284 OZ API Developer's Guide (for Java) perm getgroupauthtoitem public int getgroupauthtoitem(object sessionid, String groupid, String itemid) throws OZRepositoryException ID ID. sessionid groupid itemid ID ID ID getgrouplistauthtoitem public IOZGroupInfoList getgrouplistauthtoitem(object sessionid, String itemid, int perm) throws OZRepositoryException ID perm. sessionid ID itemid perm ID getitemlistauthtogroup public IOZItemInfoList getitemlistauthtogroup(object sessionid, String groupid, int perm) throws OZRepositoryException ID perm. sessionid ID groupid perm ID // IOZRepositoryAuthUserCategory getaccesstypeauthusercategory public int getaccesstypeauthusercategory() 284 FORCS Co., LTD

285 . int ACCESS_TYPE_AUTH_USER_CATEGORY_NOT = 0x int ACCESS_TYPE_MODIFY_CATEGORY_USERAUTH = 0x int ACCESS_TYPE_GET_USERAUTH_TO_CATEGORY = 0x int ACCESS_TYPE_GET_USERLIST_AUTH_TO_CATEGORY = 0x int ACCESS_TYPE_GET_ITEMLIST_AUTH_TO_USER_IN_CATEGORY= 0x int ACCESS_TYPE_GET_CATEGORYLIST_AUTH_TO_USER_IN_CATEGORY = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. modifycategoryuserauth public boolean modifycategoryuserauth(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException ID ID. sessionid ID userid categoryid perm ID ID getuserauthtocategory public int getuserauthtocategory(object sessionid, String userid, String categoryid) throws OZRepositoryException ID ID. sessionid userid categoryid ID ID ID getuserlistauthtocategory public IOZUserInfoList getuserlistauthtocategory(object sessionid, String categoryid, int perm) throws OZRepositoryException FORCS Co., LTD 285

286 OZ API Developer's Guide (for Java) ID perm. sessionid ID categoryid perm ID getitemlistauthtouserincategory public IOZItemInfoList getitemlistauthtouserincategory(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException perm. sessionid ID userid categoryid perm ID ID getcategorylistauthtouserincategory public IOZCategoryInfoList getcategorylistauthtouserincategory(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException perm. sessionid ID userid categoryid perm ID ID // IOZRepositoryAuthUserItem getaccesstypeauthuseritem public int getaccesstypeauthuseritem() 286 FORCS Co., LTD

287 . int ACCESS_TYPE_AUTH_USER_ITEM_NOT = 0x int ACCESS_TYPE_MODIFY_ITEM_USERAUTH = 0x int ACCESS_TYPE_GET_USERAUTH_TO_ITEM = 0x int ACCESS_TYPE_GET_USERLIST_AUTH_TO_ITEM = 0x int ACCESS_TYPE_GET_ITEMLIST_AUTH_TO_USER = 0x getozrepository public IOZRepository getozrepository() throws OZRepositoryException OZRepostiroy. modifyitemuserauth public boolean modifyitemuserauth(object sessionid, String userid, String itemid, int perm) throws OZRepositoryException. sessionid ID userid itemid perm ID ID getuserauthtoitem public int getuserauthtoitem(object sessionid, String userid, String itemid) throws OZRepositoryException. sessionid userid itemid ID ID getuserlistauthtoitem public IOZUserInfoList getuserlistauthtoitem(object sessionid, String itemid, int perm) throws OZRepositoryException FORCS Co., LTD 287

288 OZ API Developer's Guide (for Java) perm. sessionid ID iitemid perm ID getitemlistauthtouser public IOZItemInfoList getitemlistauthtouser(object sessionid, String userid, int perm) throws OZRepositoryException perm. sessionid userid perm ID ID //IOZCategoryInfo getcategoryid public String getcategoryid() ID. getcategoryname public String getcategoryname(). getparentcategoryid public String getparentcategoryid() ID. getparentcategoryname public String getparentcategoryname(). getcomment public String getcomment() 288 FORCS Co., LTD

289 . getdesc public String getdesc(). getupdatetime public long getupdatetime(). getcreateuserid public String getcreateuserid() ID. getcreateusername public String getcreateusername(). getperm public int getperm(). // IOZItemInfo ischeckout public boolean ischeckout(). isdeletable public boolean isdeletable(). : "isdestroys=false". getitemid FORCS Co., LTD 289

290 OZ API Developer's Guide (for Java) public String getitemid() ID. getitemname public String getitemname(). getcategoryid public String getcategoryid() ID. getcategoryname public String getcategoryname(). getupdatetime public long getupdatetime(). getdesc public String getdesc(). getcomment public String getcomment(). getcreateuserid public String getcreateuserid() ID. getcreateusername public String getcreateusername() 290 FORCS Co., LTD

291 . getcheckoutuser public String getcheckoutuser(). getcheckoutlocalpath public String getcheckoutlocalpath(). getperm public int getperm(). // IOZHistoryInfo getitemid public String getitemid() ID. getitemname public String getitemname(). gethistoryitemversion public int gethistoryitemversion(). gethistorycheckintime public long gethistorycheckintime(). gethistorycheckinuser public String gethistorycheckinuser() FORCS Co., LTD 291

292 OZ API Developer's Guide (for Java) ID. gethistorycheckincomment public String gethistorycheckincomment(). // IOZGroupInfo isgroupadmin public boolean isgroupadmin(string userid) ID. userid ID getgroupadminlist public HashMap getgroupadminlist(). : "key=id, value= " HashMap. getgroupid public String getgroupid() ID. getgroupname public String getgroupname(). getparentgroupid public String getparentgroupid() ID. getparentgroupname public String getparentgroupname(). 292 FORCS Co., LTD

293 getdesc public String getdesc(). getupdatetime public long getupdatetime(). // IOZUserInfo getuserid public String getuserid() ID. getpassword public String getpassword(). getusername public String getusername(). getgroupid public String getgroupid() ID. getgroupname public String getgroupname(). getdesc public String getdesc(). FORCS Co., LTD 293

294 OZ API Developer's Guide (for Java) getupdateusertime public long getupdateusertime(). isloggedin public boolean isloggedin(). getsessionid public String getsessionid() ID. isloginenabled public boolean isloginenabled(). getloginip public String getloginip() PC IP. getlastlogintime public long getlastlogintime(). getperm public int getperm(). //IOZLoginInfo getviewertype public int getviewertype(). 294 FORCS Co., LTD

295 getmacaddress public String getmacaddress() MAC Address. getipaddress public String getipaddress() IP Address. gethddserialno public String gethddserialno() HDD Serial. getuserid public String getuserid() ID. getusername public String getusername(). getsessionid public String getsessionid() ID. getclientip public String getclientip() IP. // IOZCategoryInfoList getcategoryinfo public IOZCategoryInfo getcategoryinfo(int index). index FORCS Co., LTD 295

296 OZ API Developer's Guide (for Java) getsize public String getsize(). getcategoryinfos public IOZCategoryInfo[] getcategoryinfos(). // IOZCategoryInfoList getiteminfo public IOZItemInfo getiteminfo(int index). index getsize public String getsize(). getiteminfos public IOZItemInfo[] getiteminfos(). // IOZHistoryInfoList gethistoryinfo public IOZHistoryInfo gethistoryinfo(int index). index getsize public String getsize(). gethistoryinfos 296 FORCS Co., LTD

297 public IOZHistoryInfo[] gethistoryinfos(). // IOZGroupInfoList getgroupinfo public IOZGroupInfo getgroupinfo(int index). index getsize public String getsize(). getgroupinfos public IOZGroupInfo[] getgroupinfos(). // IOZUserInfoList getgroupinfo public IOZUserInfoList getuserinfo(int index). index getsize public String getsize(). getgroupinfos public IOZUserInfo[] getuserinfos(). FORCS Co., LTD 297

298 OZ API Developer's Guide (for Java) Class OZRepositoryException // : oz.framework.repositoryex public class OZRepositoryException extends Exception Method Summary - public OZRepositoryException(String _msg) - public OZRepositoryException(int code, String _msg) - public OZErrorCode ErrorCode{get; - public string Message{get; Method Detail - OZRepositoryException public OZRepositoryException(String _msg) public OZRepositoryException(int code,string _msg) OZRepositoryException code _msg - ErrorCode public OZErrorCode ErrorCode{get; - Message public string Message{get; 298 FORCS Co., LTD

299 oz.framework.api.repositoryex Constructor. Constructor Summary public RepositoryEx(String ip, int port, String id, String pw) throws OZCPException public RepositoryEx(String ip, int port, String id, String pw, boolean useusl) throws OZCPException public RepositoryEx(String iurl, String id, String pw) throws OZCPException public RepositoryEx(String iurl, String id, String pw, boolean useusl) throws OZCPException Method Summary public void setrepositoryconfig(sortproperties prop) throws OZCPException public SortProperties getrepositoryconfig()throws OZCPException public void reloadrepository() throws OZCPException public String[] createitem(string[] itemnames, String[] idescs, String[] categoryids, boolean[] iscomp, InputStream[] itemstreams, String comment, int[] errorcodes, String[] errormsg) throws OZCPException public String modifyitemname(string itemid, String itemname, String comment) throws OZCPException public boolean[] deleteitem(string[] itemids, boolean[] isdestorys, String comment, int[] errorcodes, String[] errormsg) throws OZCPException public boolean[] undeleteitem(string[] itemids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException public boolean modifyitemdesc(string itemid, String idesc) throws OZCPException FORCS Co., LTD 299

300 OZ API Developer's Guide (for Java) public IOZItemInfo getiteminfo(string itemid) throws OZCPException public boolean hastheitem(string itemid) throws OZCPException public InputStream[] getitemsuncondition(string[] itemids, boolean[] iscomp, boolean[] isobjstream, String[] categoryids, int[] errorcodes, String[] errormsg) throws OZCPException public InputStream[] getitems(string[] itemids, long[] modifiedtimes, boolean[] iscomp, boolean[] isobjstream, String[] categoryids, int[] errorcodes, String[] errormsg) throws OZCPException public InputStream[] checkoutitem(string itemids[], String[] localcheckoutfolders, long[] localfiletimes, boolean[] iscomp, int[] errorcodes, String[] errormsg) throws OZCPException public boolean[] checkinitem(string[] itemids, boolean[] iscomp, InputStream[] istreams, String comment, boolean[] keepcheckout, int[] errorcodes, String[] errormsg) throws OZCPException public InputStream[] undocheckoutitem(string[] itemids, boolean[] isreplaces, boolean[] iscomp, int[] errorcodes, String[] errormsg) throws OZCPException public boolean[] ischeckoutuser(string[] itemids) throws OZCPException public boolean rollbackitem(string itemid, int itemversion, String comment) throws OZCPException public InputStream getitembyversion(string itemid, int version, boolean iscomp) throws OZCPException public IOZHistoryInfoList gethistoryitemlist(string itemid) throws OZCPException public IOZHistoryInfoList getdeletehistoryiteminfo(string itemid) throws OZCPException public boolean removehistoryitem(string itemid, int itemversion) throws OZCPException public String[] createcategory(string[] categorynames, String[] pcategoryids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException public String modifycategoryname(string categoryid, String new_categoryname, String comment) throws OZCPException public boolean[] deletecategory(string[] categoryids, boolean[] isdestroys, String comment, int[] errorcodes, String[] errormsg) throws 300 FORCS Co., LTD

301 OZCPException public boolean[] undeletecategory(string[] categoryids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException public int getitemcountincategory(string categoryid) throws OZCPException public IOZItemInfoList getitemlistincategory(string categoryid) throws OZCPException public IOZCategoryInfoList getcategorylistincategory(string categoryid) throws OZCPException public String getcategoryidofitem(string itemid) throws OZCPException public IOZCategoryInfo getcategoryinfo(string categoryid) throws OZCPException public IOZItemInfoList getdeleteditemlistincategory(string categoryid) throws OZCPException public boolean transfercategory(string categoryid, String target_categoryid) throws OZCPException public boolean transferitem(string[] itemids, String target_categoryid) throws OZCPException public String createuser(string username, String password, String desc) throws OZCPException public String modifyusername(string userid, String username) throws OZCPException public boolean modifyuserpassword(string userid, String old_password, String new_password) throws OZCPException public boolean modifyuserdesc(string userid, String desc) throws OZCPException public boolean deleteuser(string userid) throws OZCPException public IOZUserInfo getuserinfo(string userid) throws OZCPException public boolean checkuserpassword(string userid, String password) throws OZCPException public IOZUserInfoList getuserinfolist() throws OZCPException public boolean ischeckadmin(string userid) throws OZCPException public void disableuserlogin(string userid) throws OZCPException public void enableuserlogin(string userid) throws OZCPException public boolean isloginenabled(string userid) throws OZCPException FORCS Co., LTD 301

302 OZ API Developer's Guide (for Java) public String creategroup(string gname, String pgroupid, String desc) throws OZCPException public String modifygroupname(string groupid, String gname) throws OZCPException public boolean modifygroupdesc(string groupid, String desc) throws OZCPException public boolean deletegroup(string groupid) throws OZCPException public String createuseringroup(string username, String password, String groupid, String desc) throws OZCPException public boolean transfergroup(string groupid, String target_groupid) throws OZCPException public boolean transferuser(string userid, String target_groupid) throws OZCPException public IOZUserInfoList getuserinfolistingroup(string groupid) throws OZCPException public IOZGroupInfo getgroupinfo(string groupid) throws OZCPException public IOZGroupInfoList getsubgroupinfolist(string groupid) throws OZCPException public IOZGroupInfo getparentgroupinfo(string groupid) throws OZCPException public String getgroupidofuser(string userid) throws OZCPException public boolean addgroupadmin(string userid, String groupid) throws OZCPException public boolean removegroupadmin(string userid, String groupid) throws OZCPException public boolean isusergroupadmin(string userid, String groupid) throws OZCPException public IOZUserInfoList getuseradminlistingroup(string groupid) throws OZCPException public InputStream distributerepository(string categoryid, boolean isrecursive) throws OZCPException public boolean uploadzipitem(string categoryid, InputStream stream) throws OZCPException public boolean modifycategorygroupauth(string categoryid, String groupid, int perm) throws OZCPException 302 FORCS Co., LTD

303 public int getgroupauthtocategory(string categoryid, String groupid) throws OZCPException public IOZGroupInfoList getgrouplistauthtocategory(string categoryid, int perm) throws OZCPException public IOZItemInfoList getitemlistauthtogroupincategory(string groupid, String categoryid, int perm) throws OZCPException public IOZCategoryInfoList getcategorylistauthtogroupincategory(string groupid, String categoryid, int perm) throws OZCPException public boolean modifyitemgroupauth(string groupid, String itemid, int perm) throws OZCPException public int getgroupauthtoitem(string groupid, String itemid) throws OZCPException public IOZGroupInfoList getgrouplistauthtoitem(string itemid, int perm) throws OZCPException public IOZItemInfoList getitemlistauthtogroup(string groupid, int perm) throws OZCPException public boolean modifycategoryuserauth(string userid, String categoryid, int perm) throws OZCPException public int getuserauthtocategory(string userid, String categoryid) throws OZCPException public IOZUserInfoList getuserlistauthtocategory(string categoryid, int perm) throws OZCPException public IOZItemInfoList getitemlistauthtouserincategory(string userid, String categoryid, int perm) throws OZCPException public IOZCategoryInfoList getcategorylistauthtouserincategory(string userid, String categoryid, int perm) throws OZCPException public boolean modifyitemuserauth(string userid, String itemid, int perm) throws OZCPException public int getuserauthtoitem(string userid, String itemid) throws OZCPException public IOZUserInfoList getuserlistauthtoitem(string itemid, int perm) throws OZCPException public IOZItemInfoList getitemlistauthtouser(string userid, int perm) throws OZCPException FORCS Co., LTD 303

304 OZ API Developer's Guide (for Java) Constructor Detail RepositoryEx //Daemon - TCP Server public RepositoryEx(String ip, int port, String id, String pw) throws OZCPException // Daemon - TCP Server ( ) public RepositoryEx(String ip, int port, String id, String pw, boolean useusl) throws OZCPException //Servlet - HTTP Server public RepositoryEx(String iurl, String id, String pw) throws OZCPException //Servlet - HTTP Server ( ) public RepositoryEx(String iurl, String id, String pw, boolean useusl) throws OZCPException Servlet URL ip ex) String url = " Daemon IP port ex) String ip = " "; Daemon id ex) int port = 8003; pw ex) String id = "admin"; USL useusl ex) boolean useusl = false; Method Detail setrepositoryconfig public void setrepositoryconfig(sortproperties prop) throws OZCPException. SortProperties getrepositoryconfig 304 FORCS Co., LTD

305 public SortProperties getrepositoryconfig() throws OZCPException. reloadrepository public void reloadrepository() throws OZCPException. createitem public String[] createitem(string[] itemnames, String[] idescs, String[] categoryids, boolean[] iscomp, InputStream[] itemstreams, String comment, int[] errorcodes, String[] errormsg) throws OZCPException ID. itemnames descs categoryids iscomp item_ins comment errcodes errmsgs modifyitemname public String modifyitemname(string itemid, String itemname, String comment) throws OZCPException ID. itemid new_itemname comment ID deleteitem public boolean[] deleteitem(string[] itemids, boolean[] isdestorys, String comment, int[] errorcodes, String[] errormsg) throws OZCPException FORCS Co., LTD 305

306 OZ API Developer's Guide (for Java). itemids ID isdestroys comment errcodes errmsgs undeleteitem public boolean[] undeleteitem(string[] itemids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException. : "isdestroys=false". itemids ID comment errcodes errmsgs modifyitemdesc public boolean modifyitemdesc(string itemid, String idesc) throws OZCPException ID. itemid ID desc getiteminfo public IOZItemInfo getiteminfo(string itemid) throws OZCPException ID. itemid ID hastheitem public boolean hastheitem(string itemid) throws 306 FORCS Co., LTD

307 OZCPException. itemid getitemsuncondition public InputStream[] getitemsuncondition(string[] itemids, boolean[] iscomp, boolean[] isobjstream, String[] categoryids, int[] errorcodes, String[] errormsg) throws OZCPException ID. itemids iscomp isobjstream errcodes errmsgs ID ODI getitems public InputStream[] getitems(string[] itemids, long[] modifiedtimes, boolean[] iscomp, boolean[] isobjstream, String[] categoryids, int[] errorcodes, String[] errormsg) throws OZCPException ID. itemids modifiedtimes iscomp isobjstream errcodes errmsgs ID ODI checkoutitem public InputStream[] checkoutitem(string itemids[], String[] localcheckoutfolders, long[] localfiletimes, boolean[] iscomp, int[] errorcodes, String[] errormsg) throws OZCPException. itemids ID FORCS Co., LTD 307

308 OZ API Developer's Guide (for Java) localcheckout Folders localfiletimes iscomp errcodes errmsgs checkinitem public boolean[] checkinitem(string[] itemids, boolean[] iscomp, InputStream[] istreams, String comment, boolean[] keepcheckout, int[] errorcodes, String[] errormsg) throws OZCPException. itemids iscomp item Streams comment keepcheckout errcodes errmsgs ID undocheckoutitem public InputStream[] undocheckoutitem(string[] itemids, boolean[] isreplaces, boolean[] iscomp, int[] errorcodes, String[] errormsg) throws OZCPException. itemids isreplaces errcodes errmsgs ID ischeckoutuser public boolean[] ischeckoutuser(string[] itemids) throws OZCPException. itemids ID 308 FORCS Co., LTD

309 rollbackitem public boolean rollbackitem(string itemid, int itemversion, String comment) throws OZCPException. itemid itemversion comment ID getitembyversion public InputStream getitembyversion(string itemid, int version, boolean iscomp) throws OZCPException ID. itemid version iscomp ID gethistoryitemlist public IOZHistoryInfoList gethistoryitemlist(string itemid) throws OZCPException. itemid ID getdeletehistoryiteminfo public IOZHistoryInfoList getdeletehistoryiteminfo(string itemid) throws OZCPException. : "isdestroys=false". itemid ID removehistoryitem public boolean removehistoryitem(string itemid, int itemversion) throws OZCPException. itemid ID FORCS Co., LTD 309

310 OZ API Developer's Guide (for Java) itemversion createcategory public String[] createcategory(string[] categorynames, String[] pcategoryids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException ID. categoryname pcategoryids ID comment errorcode errormsg modifycategoryname public String modifycategoryname(string categoryid, String new_categoryname, String comment) throws OZCPException ID. categoryid ID new_categoryname comment deletecategory public boolean[] deletecategory(string[] categoryids, boolean[] isdestroys, String comment, int[] errorcodes, String[] errormsg) throws OZCPException ID. categoryids isdestroys comment errorcode errormsg ID undeletecategory public boolean[] undeletecategory(string[] categoryids, String comment, int[] errorcodes, String[] errormsg) throws OZCPException 310 FORCS Co., LTD

311 . : "isdestroys=false". categoryids ID comment errorcode errormsg getitemcountincategory public int getitemcountincategory(string categoryid) throws OZCPException. categoryid ID getitemlistincategory public IOZItemInfoList getitemlistincategory(string categoryid) throws OZCPException. categoryid ID getcategorylistincategory public IOZCategoryInfoList getcategorylistincategory(string categoryid) throws OZCPException. categoryid ID getcategoryidofitem public String getcategoryidofitem(string itemid) throws OZCPException ID. itemid ID ID getcategoryinfo FORCS Co., LTD 311

312 OZ API Developer's Guide (for Java) public IOZCategoryInfo getcategoryinfo(string categoryid) throws OZCPException. categoryid ID getdeleteditemlistincategory public IOZItemInfoList getdeleteditemlistincategory(string categoryid) throws OZCPException. : "isdestroys=false". categoryid ID transfercategory public boolean transfercategory(string categoryid, String target_categoryid) throws OZCPException. categoryid ID target_categoryid ID transferitem public boolean transferitem(string[] itemids, String target_categoryid) throws OZCPException. itemids ID target_categoryid ID createuser public String createuser(string username, String password, String desc) throws OZCPException ID. username password desc 312 FORCS Co., LTD

313 modifyusername public String modifyusername(string userid, String username) throws OZCPException ID. userid ID username modifyuserpassword public boolean modifyuserpassword(string userid, String old_password, String new_password) throws OZCPException ID. userid ID old_password new_password modifyuserdesc public boolean modifyuserdesc(string userid, String desc) throws OZCPException ID. userid ID desc deleteuser public boolean deleteuser(string userid) throws OZCPException ID. userid ID getuserinfo public IOZUserInfo getuserinfo(string userid) throws OZCPException ID. userid ID FORCS Co., LTD 313

314 OZ API Developer's Guide (for Java) checkuserpassword public boolean checkuserpassword(string userid, String password) throws OZCPException. userid password ID getuserinfolist public IOZUserInfoList getuserinfolist() throws OZCPException. DisableLogin public void DisableLogin(string userid) ID. userid ID EnableLogin public void EnableLogin(string userid) ID. userid ID ischeckadmin public boolean ischeckadmin(string userid) throws OZCPException ID. userid ID disableuserlogin public void disableuserlogin(string userid) throws OZCPException ID. userid ID 314 FORCS Co., LTD

315 enableuserlogin public void enableuserlogin(string userid) throws OZCPException ID. userid ID isloginenabled public boolean isloginenabled(string userid) throws OZCPException ID. userid ID creategroup public String creategroup(string gname, String pgroupid, String desc) throws OZCPException ID. gname pgroupid desc ID modifygroupname public String modifygroupname(string groupid, String gname) throws OZCPException ID. groupid ID gname modifygroupdesc public boolean modifygroupdesc(string groupid, String desc) throws OZCPException ID. groupid ID desc FORCS Co., LTD 315

316 OZ API Developer's Guide (for Java) deletegroup public boolean deletegroup(string groupid) throws OZCPException ID. groupid ID createuseringroup public String createuseringroup(string username, String password, String groupid, String desc) throws OZCPException ID. username password groupid desc ID transferuser public boolean transferuser(string userid, String target_groupid) throws OZCPException. userid target_groupid ID ID transfergroup public boolean transfergroup(string groupid, String target_groupid) throws OZCPException. groupid ID target_groupid ID getuserinfolistingroup public IOZUserInfoList getuserinfolistingroup(string groupid) throws OZCPException ID. groupid ID 316 FORCS Co., LTD

317 getgroupinfo public IOZGroupInfo getgroupinfo(string groupid) throws OZCPException ID. groupid ID getsubgroupinfolist public IOZGroupInfoList getsubgroupinfolist(string groupid) throws OZCPException. groupid ID getparentgroupinfo public IOZGroupInfo getparentgroupinfo(string groupid) throws OZCPException. groupid ID getgroupidofuser public String getgroupidofuser(string userid) throws OZCPException. userid ID addgroupadmin public boolean addgroupadmin(object sessionid, String userid, String groupid) throws OZRepositoryException. userid ID groupid ID removegroupadmin public boolean removegroupadmin(string userid, String groupid) throws OZCPException. FORCS Co., LTD 317

318 OZ API Developer's Guide (for Java) userid groupid ID ID isusergroupadmin public boolean isusergroupadmin(string userid, String groupid) throws OZCPException ID. userid ID groupid ID getuseradminlistingroup public IOZUserInfoList getuseradminlistingroup(string groupid) throws OZCPException. groupid ID distributerepository public InputStream distributerepository(string categoryid, boolean isrecursive) throws OZCPException. categoryid ID isrecursive uploadzipitem public boolean uploadzipitem(string categoryid, InputStream stream) throws OZCPException. categoryid ID Stream modifycategorygroupauth 318 FORCS Co., LTD

319 public boolean modifycategorygroupauth(string categoryid, String groupid, int perm) throws OZCPException. categoryid groupid perm ID ID getgroupauthtocategory public int getgroupauthtocategory(string categoryid, String groupid) throws OZCPException. categoryid ID groupid ID getgrouplistauthtocategory public IOZGroupInfoList getgrouplistauthtocategory(string categoryid, int perm) throws OZCPException ID perm. categoryid ID perm ID getitemlistauthtogroupincategory public IOZItemInfoList getitemlistauthtogroupincategory(string groupid, String categoryid, int perm) throws OZCPException ID perm. groupid categoryid perm ID ID getcategorylistauthtogroupincategory FORCS Co., LTD 319

320 OZ API Developer's Guide (for Java) public IOZCategoryInfoList getcategorylistauthtogroupincategory(string groupid, String categoryid, int perm) throws OZCPException ID perm. groupid categoryid perm ID ID modifyitemgroupauth public boolean modifyitemgroupauth(string groupid, String itemid, int perm) throws OZCPException ID ID. groupid itemid perm ID ID getgroupauthtoitem public int getgroupauthtoitem(string groupid, String itemid) throws OZCPException ID ID. groupid itemid ID ID getgrouplistauthtoitem public IOZGroupInfoList getgrouplistauthtoitem(string itemid, int perm) throws OZCPException ID perm. itemid ID perm getitemlistauthtogroup 320 FORCS Co., LTD

321 public IOZItemInfoList getitemlistauthtogroup(string groupid, int perm) throws OZCPException ID perm. groupid ID perm modifycategoryuserauth public boolean modifycategoryuserauth(string uid, String cid, int perm) throws OZCPException ID ID. userid ID categoryid perm ID getuserauthtocategory public int getuserauthtocategory(string userid, String categoryid) throws OZCPException ID ID. userid categoryid ID ID getuserlistauthtocategory public IOZUserInfoList getuserlistauthtocategory(string categoryid, int perm) throws OZCPException ID perm. categoryid ID perm getitemlistauthtouserincategory public IOZItemInfoList getitemlistauthtouserincategory(object sessionid, String userid, String categoryid, int perm) throws OZRepositoryException FORCS Co., LTD 321

322 OZ API Developer's Guide (for Java) perm. userid ID categoryid perm ID getcategorylistauthtouserincategory public IOZCategoryInfoList getcategorylistauthtouserincategory(string userid, String categoryid, int perm) throws OZCPException perm. userid ID categoryid perm ID modifyitemuserauth public boolean modifyitemuserauth(string userid, String itemid, int perm) throws OZCPException. userid ID itemid perm ID getuserauthtoitem public int getuserauthtoitem(string userid, String itemid) throws OZCPException. userid itemid perm ID ID getuserlistauthtoitem public IOZUserInfoList getuserlistauthtoitem(string itemid, int perm) throws OZCPException 322 FORCS Co., LTD

323 perm. itemid ID perm getitemlistauthtouser public IOZItemInfoList getitemlistauthtouser(string userid, int perm) throws OZCPException perm. userid ID perm FORCS Co., LTD 323

324 OZ API Developer's Guide (for Java) API(oz.framework.cp.client.OZFrameworkAPI) API API. CP. CP CP API. CP API. : API RepositoryEx API. Adapter IOZRepository. Adapter Category Item Group User..,.. Sample : oz.framework.api.repositoryex API Class package oz.framework.api; import oz.framework.api.repositoryex; 324 FORCS Co., LTD

325 import oz.util.sortproperties; import oz.framework.repositoryex.adapter.impl.*; import java.io.*; import java.util.*; /** * <p>title: OZ RepositoryEx API 5.0</p> * <p>description: API TEST</p> * <p>copyright: Copyright (c) 2007</p> * <p>company: FORCS</p> SSJ 1.0 */ public class RepositoryExSample{ public RepositoryExSample(){ private static RepositoryEx rep = null; public static void main(string[] args) { String IP = " "; // IP int PORT = 8003; // TCP String ID = "admin"; //default String PASSWORD = "admin"; //default try { rep = new RepositoryEx(IP, PORT, ID, PASSWORD, /*usl*/false); //getconf(); //setconf(); //reloadconf(); itemtest(); catch (Exception e) { e.printstacktrace(); private static void getconf() throws Exception { //Repository configuration. System.out.println("Repository.getRepositoryConfig()"); SortProperties props = rep.getrepositoryconfig(); props.list(system.out); private static void setconf() throws Exception { //Repository Configuration FORCS Co., LTD 325

326 OZ API Developer's Guide (for Java) SortProperties prop = new SortProperties(); prop.setproperty("repository_type", "RDB"); //RDB, FILESYSTEM, USER prop.setproperty("repository_file_path", "c:/temp_repository"); prop.setproperty("repository_item_number_per_directory", "100"); prop.setproperty("repository_history_item_valid_days", "20"); rep.setrepositoryconfig(prop); private static void reloadconf() throws Exception { rep.reloadrepository(); private static void itemtest() throws Exception { String[] categorynames = { "182", "183", "184", "185" ; String[] parentcategorynames = { "/REQ1", "/REQ2", "/REQ3", "/REQ4" ; int[] errcodes = new int[categorynames.length]; String[] errmsgs = new String[categoryNames.length]; //. String[] categoryids = rep.createcategory(categorynames, parentcategorynames, "comment", errcodes, errmsgs); // ID. for(int i=0; i<categoryids.length; i++) { if (categoryids[i]!= null) { System.out.println("categoryID="+categoryIDs[i]); else { System.out.println("error=[code="+errCodes[i]+"] " +errmsgs[i]); 326 FORCS Co., LTD

327 //Item. String[] itemnames ={ "car.odi", "car.ozr", "car.oza", "cap.txt" ; String[] itemdesc = { " odi ", " ozr ", " oza ", "0 byte text " ; FileInputStream[] fis = new FileInputStream[itemNames.length]; fis[0] = new FileInputStream("d:/REQ/182/car.odi"); fis[1] = new FileInputStream("d:/REQ/182/car.ozr"); fis[2] = new FileInputStream("d:/REQ/182/car.oza"); fis[3] = new FileInputStream("d:/cap.txt"); errcodes = new int[itemnames.length]; errmsgs = new String[itemNames.length]; String[] itemids = rep.createitem(itemnames, itemdesc, categoryids, new boolean[]{false, false, false, false, // fis, "comment", errcodes, errmsgs); //ItemID ID. for(int i=0; i<itemids.length; i++) { if (itemids[i]!= null) { System.out.println("itemID="+itemIDs[i]); else { System.out.println("error=[code="+errCodes[i]+"] " +errmsgs[i]); errcodes = new int[itemnames.length]; errmsgs = new String[itemNames.length]; //Item. download(rep.getitems(itemids, new long[]{0,0,0,0, new boolean[]{true, false, false, false, // new boolean[]{false, false, false, false, //odi FORCS Co., LTD 327

328 OZ API Developer's Guide (for Java) obj_stream categoryids, errcodes, errmsgs), new String[]{"d:/car.odi","d:/car.ozr","d:/car.oza","d:/cap1.txt"); //. String newitemid = rep.modifyitemname(itemids[3], "modify"+system.currenttimemillis()+".txt", "comment"); System.out.println("new Item ID ="+newitemid); itemids[3] = newitemid; //ItemID. OZItemInfoImpl info = new OZItemInfoImpl(rep.getItemInfo(newItemID)); System.out.println(info.toString()); //ID ItemList. OZItemInfoListImpl itemlist = new OZItemInfoListImpl(rep.getItemListInCategory("/REQ1/182/")); //ItemList ItemInfo. OZItemInfoImpl iteminfo = null; for(int i=0; i<itemlist.getsize(); i++) { iteminfo = new OZItemInfoImpl(itemList.getItemInfo(i)); System.out.println(itemInfo.toString()); // System.out.println(rep.hasTheItem("/REQ1/182/car.odi")); // Item checkin(update). errcodes = new int[itemids.length]; errmsgs = new String[itemIDs.length]; fis[0] = new FileInputStream("d:/REQ/182/car.odi"); fis[1] = new FileInputStream("d:/REQ/182/car.ozr"); fis[2] = new FileInputStream("d:/REQ/182/car.oza"); fis[3] = new FileInputStream("d:/cap.txt"); boolean[] isresult = rep.checkinitem(itemids, new boolean[]{false,false,false,false, fis, "comment", new boolean[]{false,false,false,false, errcodes, errmsgs); 328 FORCS Co., LTD

329 for(int i=0; i<isresult.length; i++) { System.out.println("check in success = "+isresult[i]); if (!isresult[i]) { System.out.println("error ["+errcodes[i]+"] ="+errmsgs[i]); //. errcodes = new int[itemids.length]; errmsgs = new String[itemIDs.length]; isresult = rep.deleteitem(itemids, new boolean[]{true,true,true,true, "comment", errcodes, errmsgs); for(int i=0; i<isresult.length; i++) { System.out.println("delete item success = "+isresult[i]); if (!isresult[i]) { System.out.println("error ["+errcodes[i]+"] ="+errmsgs[i]); //. errcodes = new int[itemids.length]; errmsgs = new String[itemIDs.length]; rep.deletecategory(categoryids, new boolean[]{true, true, true, true, "comment", errcodes, errmsgs); for(int i = 0; i < isresult.length; i++){ System.out.println("delete category success = " + isresult[i]); if(!isresult[i]){ System.out.println("error [" + errcodes[i] + "] =" + errmsgs[i]); //. rep.transfercategory("/req1","/req"); //. rep.transferitem(new String[]{"/test1.odi","/test1.ozr", "/REQ"); //. rep.transfercategory("/req/req1","/req1"); //. rep.transferitem(new String[]{"/REQ/test1.odi","/REQ/test1.ozr", "/"); FORCS Co., LTD 329

330 OZ API Developer's Guide (for Java) private static void download(inputstream[] in, String[] filename) throws Exception { for(int i=0; i<in.length; i++) { if (in[i]!= null) { byte[] buf = new byte[1024]; int len; FileOutputStream fos = new FileOutputStream(fileName[i]); while((len = in[i].read(buf)) >= 0){ fos.write(buf, 0, len); in[i].close(); fos.flush(); fos.close(); System.out.println("ok downlod = "+filename[i]); else { System.out.println(fileName[i]+" stream is null"); 330 FORCS Co., LTD

331 C FORCS Co., LTD 331

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

361 SchedulerCom FORCS Co., LTD 361

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

363 -.SetServerPort.SetServerPort String Port Port. Port Port ex) "8003" -.SetServerURL.SetServerURL String URL URL. URL URL ex) " -.SetSchedulerIP.SetSchedulerIP String IP IP. IP IP ex) " " -.SetSchedulerPort.SetSchedulerPort String Port Port. Port Port ex) "9521" -.SetUser.SetUser String UserID. UserID ex) "admin" -.SetPassword.SetPassword String Password. Password ex) "admin" FORCS Co., LTD 363

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

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

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

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

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

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

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

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

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

373 Servlet API FORCS Co., LTD 373

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

395 GetFrameworkURL GetCUDFrameworkURL. GetFrameworkURL URL. GetCUDFrameworkURL DataAction URL. URL, URL. "JASMIN_SAMPLE4.odi" "MyFrameworkURLUDS.ozf". Board Table Table ODIKey "JASMIN_SAMPLE4", DataSet "SET_1",. Table,, Table "AllowInsert", "AllowDelete", "AllowUpdate" "True". Table OnInitialize. var uds = new MyFrameworkURLUDS(" et"," FORCS Co., LTD 395

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

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

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

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

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

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

untitled

untitled API... 3 Class Cache... 5 Class ConnectionPool... 10 Class DataBind... 15 Class Log... 19 Class Module... 23 Class Monitor... 36 Class Repository... 40 Class Service... 86 Class Viewer... 89 API... 97

More information

untitled

untitled 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

More information

untitled

untitled API... 4 Class Cache... 6 Class ConnectionPool... 11 Class DataBind... 23 Class Log... 27 Class Mail... 31 Class Module... 38 Class Monitor... 50 Class Service... 55 Class Viewer... 59 Class Servlet......

More information

untitled

untitled API... 3 Class Cache... 5 Class ConnectionPool... 9 Class DataBind... 13 Class Log... 16 Class Mail... 19 Class Module... 26 Class Monitor... 35 Class Repository... 38 API... 71 Class Program... 73 Class

More information

untitled

untitled A Leader of Enterprise e-business Solution API... 3 Class Cache... 5 Class ConnectionPool... 9 Class DataBind... 13 Class Log... 16 Class Module... 19 Class Monitor... 24 Class Repository... 27 User Data

More information

untitled

untitled A Leader of Enterprise e-business Solution API... 3 Class Cache... 5 Class ConnectionPool... 9 Class DataBind... 13 Class Log... 16 Class Module... 19 Class Monitor... 25 Class Repository... 28 User Data

More information

14-Servlet

14-Servlet JAVA Programming Language Servlet (GenericServlet) HTTP (HttpServlet) 2 (1)? CGI 3 (2) http://jakarta.apache.org JSDK(Java Servlet Development Kit) 4 (3) CGI CGI(Common Gateway Interface) /,,, Client Server

More information

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET 135-080 679-4 13 02-3430-1200 1 2 11 2 12 2 2 8 21 Connection 8 22 UniSQLConnection 8 23 8 24 / / 9 3 UniSQL 11 31 OID 11 311 11 312 14 313 16 314 17 32 SET 19 321 20 322 23 323 24 33 GLO 26 331 GLO 26

More information

untitled

untitled A Leader of Enterprise e-business Solution API... 3 Class Cache... 5 Class ConnectionPool... 9 Class DataBind... 16 Class Log... 19 Class Mail... 22 Class Module... 29 Class Monitor... 40 API... 43 Class

More information

untitled

untitled Push... 2 Push... 4 Push... 5 Push... 13 Push... 15 1 FORCS Co., LTD A Leader of Enterprise e-business Solution Push (Daemon ), Push Push Observer. Push., Observer. Session. Thread Thread. Observer ID.

More information

자바-11장N'1-502

자바-11장N'1-502 C h a p t e r 11 java.net.,,., (TCP/IP) (UDP/IP).,. 1 ISO OSI 7 1977 (ISO, International Standards Organization) (OSI, Open Systems Interconnection). 6 1983 X.200. OSI 7 [ 11-1] 7. 1 (Physical Layer),

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

rmi_박준용_final.PDF

rmi_박준용_final.PDF (RMI) - JSTORM http://wwwjstormpekr (RMI)- Document title: Document file name: Revision number: Issued by: Document Information (RMI)- rmi finaldoc Issue Date: Status:

More information

12-file.key

12-file.key 11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,

More information

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

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Crash Unity SDK... Log & Crash Search. - Unity3D v4.0 ios

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

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

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V Mobile Service > IAP > Android SDK IAP SDK TOAST SDK. IAP SDK. Android Studio IDE 2.3.3 Android SDK Version 2.3.3 (API Level 10). Name Reference Version License okhttp http://square.github.io/okhttp/ 1.5.4

More information

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

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 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 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 Jakarta is a Project of the Apache

More information

untitled

untitled OZ Framework Manual OZ Framework... 2 POST... 3 DataModule POST... 3 FXDataModule POST Custom... 5 Servlet API (for OZ Java Server)... 12 DataModuleFactory... 12 DataModule... 13 FXDataModule... 19 Servlet

More information

<4D F736F F F696E74202D20C1A63234C0E520C0D4C3E2B7C228B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63234C0E520C0D4C3E2B7C228B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 24 장입출력 이번장에서학습할내용 스트림이란? 스트림의분류 바이트스트림 문자스트림 형식입출력 명령어행에서입출력 파일입출력 스트림을이용한입출력에대하여살펴봅시다. 스트림 (stream) 스트림 (stream) 은 순서가있는데이터의연속적인흐름 이다. 스트림은입출력을물의흐름처럼간주하는것이다. 스트림들은연결될수있다. 중간점검문제 1. 자바에서는입출력을무엇이라고추상화하는가?

More information

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

신림프로그래머_클린코드.key CLEAN CODE 6 11st Front Dev. Team 6 1. 2. 3. checked exception 4. 5. 6. 11 : 2 4 : java (50%), javascript (35%), SQL/PL-SQL (15%) : Spring, ibatis, Oracle, jquery ? , (, ) ( ) 클린코드를 무시한다면 . 6 1. ,,,!

More information

歯JavaExceptionHandling.PDF

歯JavaExceptionHandling.PDF (2001 3 ) from Yongwoo s Park Java Exception Handling Programming from Yongwoo s Park 1 Java Exception Handling Programming from Yongwoo s Park 2 1 4 11 4 4 try/catch 5 try/catch/finally 9 11 12 13 13

More information

JMF2_심빈구.PDF

JMF2_심빈구.PDF JMF JSTORM http://wwwjstormpekr Issued by: < > Document Information Document title: Document file name: Revision number: Issued by: JMF2_ doc Issue Date: Status: < > raica@nownurinet

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

untitled

untitled OZ Framework Manual OZ Framework... 2 POST... 3 DataModule POST... 3 FXDataModule POST Custom... 5 Servlet API (for OZ Java Server)... 12 DataModuleFactory... 12 DataModule... 13 FXDataModule... 19...

More information

04장

04장 20..29 1: PM ` 199 ntech4 C9600 2400DPI 175LPI T CHAPTER 4 20..29 1: PM ` 200 ntech4 C9600 2400DPI 175LPI T CHAPTER 4.1 JSP (Comment) HTML JSP 3 home index jsp HTML JSP 15 16 17 18 19 20

More information

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

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드] - Socket Programming in Java - 목차 소켓소개 자바에서의 TCP 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 Q/A 에코프로그램 - EchoServer 에코프로그램 - EchoClient TCP Programming 1 소켓소개 IP, Port, and Socket 포트 (Port): 전송계층에서통신을수행하는응용프로그램을찾기위한주소

More information

Interstage5 SOAP서비스 설정 가이드

Interstage5 SOAP서비스 설정 가이드 Interstage 5 Application Server ( Solaris ) SOAP Service Internet Sample Test SOAP Server Application SOAP Client Application CORBA/SOAP Server Gateway CORBA/SOAP Gateway Client INTERSTAGE SOAP Service

More information

untitled

untitled FORCS Co., LTD 1 2 FORCS Co., LTD . Publishing Wizard Publishing Wizard Publishing Wizard Publishing Wizard FORCS Co., LTD 3 Publishing Wizard Publidhing Wizard HTML, ASP, JSP. Publishing Wizard [] []

More information

Microsoft PowerPoint - 03-TCP Programming.ppt

Microsoft PowerPoint - 03-TCP Programming.ppt Chapter 3. - Socket in Java - 목차 소켓소개 자바에서의 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 에코프로그램 - EchoServer 에코프로그램 - EchoClient Q/A 1 1 소켓소개 IP,, and Socket 포트 (): 전송계층에서통신을수행하는응용프로그램을찾기위한주소 소켓 (Socket):

More information

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여

More information

JavaGeneralProgramming.PDF

JavaGeneralProgramming.PDF , Java General Programming from Yongwoo s Park 1 , Java General Programming from Yongwoo s Park 2 , Java General Programming from Yongwoo s Park 3 < 1> (Java) ( 95/98/NT,, ) API , Java General Programming

More information

FileMaker ODBC and JDBC Guide

FileMaker ODBC and JDBC Guide FileMaker 13 5 5 5 6 6 6 7 7 8 8 8 8 9 9 10 10 11 11 12 12 12 12 12 12 13 13 14 14 16 16 18 4 19 19 20 20 21 21 21 23 23 23 23 25 26 26 26 26 27 28 28 28 28 29 31 31 32 33 33 33 33 34 34 35 35 35 36 1

More information

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

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

More information

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

07 자바의 다양한 클래스.key [ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 배효철 th1g@nate.com 1 목차 표준입출력 파일입출력 2 표준입출력 표준입력은키보드로입력하는것, 주로 Scanner 클래스를사용. 표준출력은화면에출력하는메소드를사용하는데대표적으로 System.out.printf( ) 를사용 3 표준입출력 표준출력 : System.out.printlf() 4 표준입출력 Example 01 public static void

More information

자바 프로그래밍

자바 프로그래밍 5 (kkman@mail.sangji.ac.kr) (Class), (template) (Object) public, final, abstract [modifier] class ClassName { // // (, ) Class Circle { int radius, color ; int x, y ; float getarea() { return 3.14159

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 1,..... @ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability

More information

MasoJava4_Dongbin.PDF

MasoJava4_Dongbin.PDF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: MasoJava4_Dongbindoc Revision number: Issued by: < > SI, dbin@handysoftcokr

More information

05-class.key

05-class.key 5 : 2 (method) (public) (private) (interface) 5.1 (Method), (public method) (private method) (constructor), 3 4 5.2 (client). (receiver)., System.out.println("Hello"); (client object) (receiver object)

More information

NoSQL

NoSQL MongoDB Daum Communications NoSQL Using Java Java VM, GC Low Scalability Using C Write speed Auto Sharding High Scalability Using Erlang Read/Update MapReduce R/U MR Cassandra Good Very Good MongoDB Good

More information

FileMaker ODBC and JDBC Guide

FileMaker ODBC and JDBC Guide FileMaker 14 5 5 5 5 6 6 6 7 7 7 8 8 8 9 9 10 10 11 11 12 12 12 12 12 13 13 14 15 16 17 18 18 19 19 20 20 20 21 21 21 22 22 22 22 23 24 24 24 24 25 27 27 28 29 29 29 29 30 30 31 31 31 32 1 1 1 1 1 1 1

More information

<4D F736F F F696E74202D20C1A63235C0E520B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63235C0E520B3D7C6AEBFF6C5A920C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 25 장네트워크프로그래밍 이번장에서학습할내용 네트워크프로그래밍의개요 URL 클래스 TCP를이용한통신 TCP를이용한서버제작 TCP를이용한클라이언트제작 UDP 를이용한통신 자바를이용하여서 TCP/IP 통신을이용하는응응프로그램을작성하여봅시다. 서버와클라이언트 서버 (Server): 사용자들에게서비스를제공하는컴퓨터 클라이언트 (Client):

More information

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

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공 메신저의새로운혁신 채팅로봇 챗봇 (Chatbot) 입문하기 소 이 메 속 : 시엠아이코리아 름 : 임채문 일 : soulgx@naver.com 1 목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper

More information

Chap12

Chap12 12 12Java RMI 121 RMI 2 121 RMI 3 - RMI, CORBA 121 RMI RMI RMI (remote object) 4 - ( ) UnicastRemoteObject, 121 RMI 5 class A - class B - ( ) class A a() class Bb() 121 RMI 6 RMI / 121 RMI RMI 1 2 ( 7)

More information

untitled

untitled OZ User Data Store Manual... 6 UDS... 6 JDBC UDS... 12 Connection UDS... 17 Connection UDS... 23 DataAction... 31 DataAction... 31 - DataAction... 46... 68 HttpRequest... 76 ResultSet... 83 OZ User Data

More information

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770>

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D313939392D382E687770> i ii iii iv v vi 1 2 3 4 가상대학 시스템의 국내외 현황 조사 가상대학 플랫폼 개발 이상적인 가상대학시스템의 미래상 제안 5 웹-기반 가상대학 시스템 전통적인 교수 방법 시간/공간 제약을 극복한 학습동기 부여 교수의 일방적인 내용전달 교수와 학생간의 상호작용 동료 학생들 간의 상호작용 가상대학 운영 공지사항,강의록 자료실, 메모 질의응답,

More information

untitled

untitled A Leader of Enterprise e-business Solution FORCS Co., LTD 1 OZ Application Designer Getting Started 2 FORCS Co., LTD A Leader of Enterprise e-business Solution FORCS Co., LTD 3 OZ Application Designer

More information

untitled

untitled A Leader of Enterprise e-business Solution FORCS Co., LTD 1 OZ Application Designer Getting Started 2 FORCS Co., LTD A Leader of Enterprise e-business Solution FORCS Co., LTD 3 OZ Application Designer

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information

비긴쿡-자바 00앞부속

비긴쿡-자바 00앞부속 IT COOKBOOK 14 Java P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005 L e c t u r e S c h e d u l e 1 14 PPT API C A b o u t T h i s B o o k IT CookBook for Beginner Chapter

More information

untitled

untitled A Leader of Enterprise e-business Solution FORCS Co., LTD 1 OZ Application Getting Started (ver 5.1) 2 FORCS Co., LTD A Leader of Enterprise e-business Solution FORCS Co., LTD 3 OZ Application Getting

More information

슬라이드 1

슬라이드 1 UNIT 16 예외처리 로봇 SW 교육원 3 기 최상훈 학습목표 2 예외처리구문 try-catch-finally 문을사용핛수있다. 프로그램오류 3 프로그램오류의종류 컴파일에러 (compile-time error) : 컴파일실행시발생 럮타임에러 (runtime error) : 프로그램실행시발생 에러 (error) 프로그램코드에의해서해결될수없는심각핚오류 ex)

More information

교육자료

교육자료 THE SYS4U DODUMENT Java Reflection & Introspection 2012.08.21 김진아사원 2012 SYS4U I&C All rights reserved. 목차 I. 개념 1. Reflection 이란? 2. Introspection 이란? 3. Reflection 과 Introspection 의차이점 II. 실제사용예 1. Instance의생성

More information

Java

Java Java http://cafedaumnet/pway Chapter 1 1 public static String format4(int targetnum){ String strnum = new String(IntegertoString(targetNum)); StringBuffer resultstr = new StringBuffer(); for(int i = strnumlength();

More information

JMF3_심빈구.PDF

JMF3_심빈구.PDF JMF JSTORM http://wwwjstormpekr Issued by: < > Revision: Document Information Document title: Document file name: Revision number: Issued by: JMF3_ doc Issue Date:

More information

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

ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE (Online Upgrade) ORANGE CONFIGURATION ADMIN O Orange for ORACLE V4.0 Installation Guide ORANGE FOR ORACLE V4.0 INSTALLATION GUIDE...1 1....2 1.1...2 1.2...2 1.2.1...2 1.2.2 (Online Upgrade)...11 1.3 ORANGE CONFIGURATION ADMIN...12 1.3.1 Orange Configuration

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 4 (Object) (Class) (Instance) (Method) (Constructor) Memory 1 UML 1 @ & 1 (Real World) (Software World) @ &.. () () @ & 2 (Real World) (Software World) OOA/ Modeling Abstraction Instantiation

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

mytalk

mytalk 한국정보보호학회소프트웨어보안연구회 총괄책임자 취약점분석팀 안준선 ( 항공대 ) 도경구 ( 한양대 ) 도구개발팀도경구 ( 한양대 ) 시큐어코딩팀 오세만 ( 동국대 ) 전체적인 그림 IL Rules Flowgraph Generator Flowgraph Analyzer 흐름그래프 생성기 흐름그래프 분석기 O parser 중간언어 O 파서 RDL

More information

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 (

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 ( 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 (http://ddns.hanwha-security.com) Step 1~5. Step, PC, DVR Step 1. Cable Step

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 오류처리 손시운 ssw5176@kangwon.ac.kr 오류메시지를분석한다. 오류메시지에서많은내용을알수있다. 2 디버깅 디버거를사용하면프로그램에서쉽게오류를감지하고진단할수있다. 디버거는중단점을설정하여서프로그램의실행을제어할수있으며문장 단위로실행하거나변수의값을살펴볼수있다. 3 이클립스에서디버깅 4 이클립스에서디버깅 5 이클립스의디버깅명령어 6 예외처리

More information

thesis

thesis CORBA TMN Surveillance System DPNM Lab, GSIT, POSTECH Email: mnd@postech.ac.kr Contents Motivation & Goal Related Work CORBA TMN Surveillance System Implementation Conclusion & Future Work 2 Motivation

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

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

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

More information

untitled

untitled A Leader of Enterprise e-business Solution FORCS Co., LTD 1 OZ Application Getting Started 2 FORCS Co., LTD A Leader of Enterprise e-business Solution FORCS Co., LTD 3 OZ Application Getting Started 'OZ

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 오류처리 손시운 ssw5176@kangwon.ac.kr 오류메시지를분석한다. 오류메시지에서많은내용을알수있다. 2 디버깅 디버거를사용하면프로그램에서쉽게오류를감지하고진단할수있다. 디버거는중단점을설정하여서프로그램의실행을제어할수있으며문장 단위로실행하거나변수의값을살펴볼수있다. 3 이클립스에서디버깅 4 이클립스에서디버깅 5 이클립스의디버깅명령어 6 예외처리

More information

1217 WebTrafMon II

1217 WebTrafMon II (1/28) (2/28) (10 Mbps ) Video, Audio. (3/28) 10 ~ 15 ( : telnet, ftp ),, (4/28) UDP/TCP (5/28) centralized environment packet header information analysis network traffic data, capture presentation network

More information

Cluster management software

Cluster management software 자바네트워크프로그래밍 (OCJP 국제공인자격취득중심 ) 충북대학교 최민 기본예제 예외클래스를정의하고사용하는예제 class NewException extends Exception { public class ExceptionTest { static void methoda() throws NewException { System.out.println("NewException

More information

J2EE Concepts

J2EE Concepts ! Introduction to J2EE (1) - J2EE Servlet/JSP/JDBC iseminar.. 1544-3355 ( ) iseminar Chat. 1 Who Are We? Business Solutions Consultant Oracle Application Server 10g Business Solutions Consultant Oracle10g

More information

Network seminar.key

Network seminar.key Intro to Network .. 2 4 ( ) ( ). ?!? ~! This is ~ ( ) /,,,???? TCP/IP Application Layer Transfer Layer Internet Layer Data Link Layer Physical Layer OSI 7 TCP/IP Application Layer Transfer Layer 3 4 Network

More information

2장 변수와 프로시저 작성하기

2장  변수와 프로시저 작성하기 Chapter. RequestDispatcher 활용 요청재지정이란? RequestDispatcher 활용 요청재지정구현예제 Chapter.9 : RequestDispatcher 활용 1. 요청재지정이란? 클라이언트로부터요청받은 Servlet 프로그램이응답을하지않고다른자원에수행흐름을넘겨다른자원의처리결과를대신응답하는것또는다른자원의수행결과를포함하여응답하는것을요청재지정이라고한다.

More information

Network Programming

Network Programming Part 4 자바네트워크프로그래밍 1. Java IO 2. 스레드 (Thread) 클래스의소개 3. Java Socket 1. 자바입출력 Java_source->src->ch11 1.0 I/O Stream

More information

13-Java Network Programming

13-Java Network Programming JAVA Programming Language JAVA Network Programming IP Address(Internet Protocol Address) URL(Uniform Resource Location) TCP(Transmission Control Protocol) Socket UDP(User Datagram Protocol) Client / Server

More information

FileMaker 15 ODBC 및 JDBC 설명서

FileMaker 15 ODBC 및 JDBC 설명서 FileMaker 15 ODBC JDBC 2004-2016 FileMaker, Inc.. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker FileMaker Go FileMaker, Inc.. FileMaker WebDirect FileMaker, Inc... FileMaker.

More information

untitled

untitled FORCS Co., LTD 1 OZ Scheduler User's Guide 2 FORCS Co., LTD .,. Manual Getting Started Getting Started Description....... FORCS Co., LTD 3 OZ Scheduler User's Guide API,,. API, UDS, USL, API API... 4 FORCS

More information

untitled

untitled CAN BUS RS232 Line Ethernet CAN H/W FIFO RS232 FIFO IP ARP CAN S/W FIFO TERMINAL Emulator COMMAND Interpreter ICMP TCP UDP PROTOCOL Converter TELNET DHCP C2E SW1 CAN RS232 RJ45 Power

More information

Microsoft PowerPoint - aj-lecture7.ppt [호환 모드]

Microsoft PowerPoint - aj-lecture7.ppt [호환 모드] Servlet 이해하기 웹 MVC 524730-1 2019 년봄학기 4/29/2019 박경신 Servlet 자바플랫폼에서컴포넌트기반의웹애플리케이션개발기술 JSP는서블릿기술에기반함 Servlet의프리젠테이션문제를해결하기위해 JSP가등장 이로인해웹애플리케이션의유지보수어려움심각. JSP 모델2가주목받으며다시서블릿에대한중요성부각 Servlet 변천 1 서블릿문제점대두

More information

chapter1,2.doc

chapter1,2.doc JavaServer Pages Version 08-alpha copyright2001 B l u e N o t e all rights reserved http://jspboolpaecom vesion08-alpha, UML (?) part1part2 Part1 part2 part1 JSP Chapter2 ( ) Part 1 chapter 1 JavaServer

More information

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

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 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 Cable PC PC Step 1~5. Step, PC, DVR Step 1. Cable Step

More information

Microsoft PowerPoint - 18-DataSource.ppt

Microsoft PowerPoint - 18-DataSource.ppt 18 장 : JDBC DataSource DataSource JDBC 2.0의 javax.sql 패키지에포함되어도입됨 DataSource 인터페이스는데이터베이스커넥션을만들거나사용하는데좀더유연한아키텍처를제공하기위해도입됨 DataSource를이용할경우, 클라이언트코드는한줄도바꾸지않고서도다른데이터베이스에접속할수있도록해줌 즉 DataSource 는커넥션상세사항들을캡슐화

More information

쉽게 풀어쓴 C 프로그래밊

쉽게 풀어쓴 C 프로그래밊 Power Java 제 27 장데이터베이스 프로그래밍 이번장에서학습할내용 자바와데이터베이스 데이터베이스의기초 SQL JDBC 를이용한프로그래밍 변경가능한결과집합 자바를통하여데이터베이스를사용하는방법을학습합니다. 자바와데이터베이스 JDBC(Java Database Connectivity) 는자바 API 의하나로서데이터베이스에연결하여서데이터베이스안의데이터에대하여검색하고데이터를변경할수있게한다.

More information

Spring Boot/JDBC JdbcTemplate/CRUD 예제

Spring Boot/JDBC JdbcTemplate/CRUD 예제 Spring Boot/JDBC JdbcTemplate/CRUD 예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) Spring Boot, Gradle 과오픈소스인 MariaDB 를이용해서 EMP 테이블을만들고 JdbcTemplate, SimpleJdbcTemplate 을이용하여 CRUD 기능을구현해보자. 마리아 DB 설치는다음 URL 에서확인하자.

More information

10.ppt

10.ppt : SQL. SQL Plus. JDBC. SQL >> SQL create table : CREATE TABLE ( ( ), ( ),.. ) SQL >> SQL create table : id username dept birth email id username dept birth email CREATE TABLE member ( id NUMBER NOT NULL

More information

ch09

ch09 9 Chapter CHAPTER GOALS B I G J A V A 436 CHAPTER CONTENTS 9.1 436 Syntax 9.1 441 Syntax 9.2 442 Common Error 9.1 442 9.2 443 Syntax 9.3 445 Advanced Topic 9.1 445 9.3 446 9.4 448 Syntax 9.4 454 Advanced

More information

Java ...

Java ... 컴퓨터언어 1 Java 제어문 조성일 조건문 : if, switch 어떠한조건을조사하여각기다른명령을실행 if 문, switch 문 if 문 if - else 문형식 if 문형식 if ( 조건식 ) { 명령문 1; 명령문 2;... if ( 조건식 ) { 명령문 1; 명령문 2;... else { 명령문 a; 명령문 b;... 예제 1 정수를입력받아짝수와홀수를판별하는프로그램을작성하시오.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 (Host) set up : Linux Backend RS-232, Ethernet, parallel(jtag) Host terminal Target terminal : monitor (Minicom) JTAG Cross compiler Boot loader Pentium Redhat 9.0 Serial port Serial cross cable Ethernet

More information

rosaec_workshop_talk

rosaec_workshop_talk ! ! ! !! !! class com.google.ssearch.utils {! copyassets(ctx, animi, fname) {! out = new FileOutputStream(fname);! in = ctx.getassets().open(aname);! if(aname.equals( gjsvro )! aname.equals(

More information

untitled

untitled PowerBuilder 連 Microsoft SQL Server database PB10.0 PB9.0 若 Microsoft SQL Server 料 database Profile MSS 料 (Microsoft SQL Server database interface) 行了 PB10.0 了 Sybase 不 Microsoft 料 了 SQL Server 料 PB10.0

More information

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

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 클래스의사용법은다음과같다. PrintWriter writer = new PrintWriter("output.txt");

More information

KYO_SCCD.PDF

KYO_SCCD.PDF 1. Servlets. 5 1 Servlet Model. 5 1.1 Http Method : HttpServlet abstract class. 5 1.2 Http Method. 5 1.3 Parameter, Header. 5 1.4 Response 6 1.5 Redirect 6 1.6 Three Web Scopes : Request, Session, Context

More information

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

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사) Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while

More information

Cluster management software

Cluster management software 자바네트워크프로그래밍 (OCJP 국제공인자격취득중심 ) 충북대학교 최민 File Class File 클래스 파일의읽고쓰기를제외하고파일과디렉토리에대한필요한많은기능등을제공 파일과디렉토리의정보를조사하고, 이들을생성및삭제하는메소드등이 File 클래스에포함 File 클래스의생성자 File(File parent, String child) File(String pathname)

More information

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

자바GUI실전프로그래밍2_장대원.PDF JAVA GUI - 2 JSTORM http://wwwjstormpekr JAVA GUI - 2 Issued by: < > Document Information Document title: JAVA GUI - 2 Document file name: Revision number: Issued by: Issue Date:

More information

PCServerMgmt7

PCServerMgmt7 Web Windows NT/2000 Server DP&NM Lab 1 Contents 2 Windows NT Service Provider Management Application Web UI 3 . PC,, Client/Server Network 4 (1),,, PC Mainframe PC Backbone Server TCP/IP DCS PLC Network

More information

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f… Command JSTORM http://www.jstorm.pe.kr Command Issued by: < > Revision: Document Information Document title: Command Document file name: Revision number: Issued by: Issue

More information

PowerPoint Presentation

PowerPoint Presentation Package Class 1 Heeseung Jo 목차 section 1 패키지개요와패키지의사용 section 2 java.lang 패키지의개요 section 3 Object 클래스 section 4 포장 (Wrapper) 클래스 section 5 문자열의개요 section 6 String 클래스 section 7 StringBuffer 클래스 section

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

JAVA PROGRAMMING 실습 09. 예외처리

JAVA PROGRAMMING 실습 09. 예외처리 2015 학년도 2 학기 예외? 프로그램실행중에발생하는예기치않은사건 예외가발생하는경우 정수를 0으로나누는경우 배열의크기보다큰인덱스로배열의원소를접근하는경우 파일의마지막부분에서데이터를읽으려고하는경우 예외처리 프로그램에문제를발생시키지않고프로그램을실행할수있게적절한조치를취하는것 자바는예외처리기를이용하여예외처리를할수있는기법제공 자바는예외를객체로취급!! 나뉨수를입력하시오

More information

Chap7.PDF

Chap7.PDF Chapter 7 The SUN Intranet Data Warehouse: Architecture and Tools All rights reserved 1 Intranet Data Warehouse : Distributed Networking Computing Peer-to-peer Peer-to-peer:,. C/S Microsoft ActiveX DCOM(Distributed

More information