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 Publisher... 78 Class Scheduler... 82 Class TaskHolidayInfo... 112 Class TaskHolidayGroupInfo... 115 RDB Store DataAction for.net... 119 RDB Store DataAction... 120 RDB Store DataAction... 121 User Data Store for.net... 123 UDS for.net... 124 UDS for.net... 126 FORCS Co., LTD 1
OZ API Developer's Guide (for.net) UDS for.net... 129 UDS for.net... 133 User Defined Log... 149 UDL... 150 UDL... 151 UDL... 165... 193 Interface Repository... 194 Class RepositoryEX... 235... 256 2 FORCS Co., LTD
API Class Cache Class ConnectionPool Class DataBind Class Log Class Mail Class Module Class Monitor Class Repository FORCS Co., LTD 3
OZ API Developer's Guide (for.net) API. API. Cache Connection Pool DataBind Log Mail Module Monitor Repository.. Pool ADO.NET/ODBC,..,,..... API. OZServer.NET.dll SAP.Connector.dll Interop.MSScriptContr ol.dll. SAP. Jscript COM. 4 FORCS Co., LTD
Constructor Summary Cache(string url, string id, string pw, bool autologin, bool useusl) Method Summary OZAttributeList GetConfiguration() void SetConfiguration(OZAttributeList attrs) Constructor Detail ASP.NET public Cache(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; Method Detail getcacheconfiguration public OZAttributeList GetCacheConfiguration () throws OZAPIException FORCS Co., LTD 5
OZ API Developer's Guide (for.net).,,,,. setcacheconfiguration public void SetCacheConfiguration (OZAttributeList attrs) throws OZAPIException.,,,, attrs Class OZAPIException(oz.framework.cp.OZAPIException) API Exception. API OZAPIException. - getmessage public String getmessage(). OZAttributeList (oz.util.ozattributelist.cs) of GetCacheConfiguration, SetCacheConfiguration getcacheconfiguration(), setcacheconfiguration(). - This[string key] get;set; This[string key] get;set; key. Key Property key. 6 FORCS Co., LTD
Key Value Active CACHE_FILE_ PATH DM_CACHE_FI LE_PATH memorycache ValidTime diskcachevali dtime FreeMemoryPe rcentage "true" "false" (string) (string) (Unit second) (Unit second) (%) ex) p["datamodule.active"] = "false"; ex) p["cache_file_path"] = "%OZ_HOME%/cache"; Data Module ex) p["dm_cache_file_path"] = "%OZ_HOME%/cache_dm/"; (:) ex) p["datamodule.memorycachevalidtime"] = "100"; (:) ex) p["datamodule.diskcachevalidtime"] = "100"; ex) p["datamodule.freememorypercentage"] = "20"; : " -cachemngr.properties". Sample : CacheSample.cs using System; using oz.framework.api; namespace sample /// <summary> /// Cache /// </summary> public class CacheTest public static void Main() string url = "http://127.0.0.1/oztest/server.aspx"; string id = "admin"; string password = "admin"; Cache c = new Cache(url, id, password, true, true); FORCS Co., LTD 7
OZ API Developer's Guide (for.net) oz.util.ozattributelist attrs = c.getconfiguration(); Console.WriteLine(attrs); c.setconfiguration(attrs); 8 FORCS Co., LTD
Constructor Summary ConnectionPool(string url, string id, string pw, bool autologin, bool useusl) Method Summary void AddPool(ConnectionPoolInfo pool) void RemovePool(string alias) ConnectionPoolInfo[] GetPoolInfos() ConnectionPoolStatus[] GetPoolStatuses() ConnectionPoolInfo GetPoolInfo(string alias) void Save() Constructor Detail ASP.NET public ConnectionPool(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; FORCS Co., LTD 9
OZ API Developer's Guide (for.net) Method Detail AddPool public void AddPool(ConnectionPoolInfo pool) throws OZAPIException.,,,,, SID, DB, DB,,,,,, URL,,. pool ConnectionPoolInfo RemovePool public void RemovePool(string alias) throws OZAPIException ConnectionPool. alias ConnectionPool GetPoolInfos public ConnectionPoolInfo[] GetPoolInfos() throws OZAPIException ConnectionPool. GetPoolStatuses public ConnectionPooStatus[] GetPoolStatuses() throws OZAPIException ConnectionPool. GetPoolInfo public ConnectionPoolInfo GetPoolInfo(String alias) throws OZAPIException ConnectionPool ConnectionPoolInfo. alias ConnectionPool Save public void Save() throws OZAPIException throws OZAPIException ConnectionPool. 10 FORCS Co., LTD
Class ConnectionPoolInfo(oz.framework.db.ConnectionPoolInfo). - DecodeCharSet public string DecodeCharSetget;set; ConnectionPool - EnecodeCharSet public string EncodeCharSetget;set; ConnectionPool ConnectionPoolStatus(oz.framework.db.ConnectionPoolStatus) ConnectionPool. - ConnectionPool.. Status OK DRIVER_ERROR CONNECTION_ERROR ConnectionPool ConnectionPool JDBC ConnectionPool DBMS Sample : ConnectionPoolTest.cs using System; using oz.framework.api; using oz.framework.db; namespace sample public class ConnectionPoolTest public static void Main() string url = "http://127.0.0.1/oztest/server.aspx"; FORCS Co., LTD 11
OZ API Developer's Guide (for.net) string id = "admin"; string password = "admin"; ConnectionPool cp = new ConnectionPool(url, id, password, true, true); string alias = "connection_pool_test"; ConnectionPoolInfo poolinfo = new ConnectionPoolInfo(); poolinfo.alias = alias; poolinfo.vendor = "MSSQL"; poolinfo.items["serveraddress"] = "218.36.12.88"; poolinfo.items["portno"] = "1433"; poolinfo.items["dbname"] = "QATEST"; poolinfo.items["user"] = "user1"; poolinfo.items["password"] = "user123"; poolinfo.maxconnections = 20; poolinfo.initialconnections = 5; poolinfo.timeout = 5; // //poolinfo.encode = "ISO-8859-1"; //poolinfo.decode = "ks_c_5601-1987"; cp.addpool(poolinfo); ConnectionPoolInfo addedpoolinfo = cp.getpoolinfo(alias); Console.WriteLine(addedPoolInfo); cp.removepool(alias); ConnectionPoolInfo[] poolinfos = cp.getpoolinfos(); foreach(connectionpoolinfo cpi in poolinfos) Console.WriteLine(cpi); ConnectionPoolStatus[] statuses = cp.getpoolstatuses(); foreach(connectionpoolstatus status in statuses) Console.WriteLine(status); 12 FORCS Co., LTD
Constructor Summary DataBind(string url, string id, string pw, bool autologin, bool useusl) Method Summary void SetConfigration(OZAttributeList config) OZAttributeList GetConfigration() Constructor Detail ASP.NET public DataBind(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; Method Detail SetConfigration public void SetConfigration(OZAttributeList config) throws OZAPIException FORCS Co., LTD 13
OZ API Developer's Guide (for.net) DataBind, "databind.properties". config DataBind GetConfigration public OZAttributeList GetConfigration() throws OZAPIException DataBind, "databind.properties". - Key SetConfigration() GetConfigration() key. Key Value ConcurrentFetchSize ConcurrentFirstRow FetchType "Concurrent" Stream. byte, 4096, 256. :,. FetchType "Concurrent"., 0. : 0. Sample : DataBindTest.cs using System; using oz.util; using oz.framework.api; namespace sample 14 FORCS Co., LTD
/// <summary> /// DataBindTest /// </summary> public class DataBindTest public static void Main() string url = "http://127.0.0.1/oztest/server.aspx"; string id = "admin"; string password = "admin"; true, true); DataBind db = new DataBind(url, id, password, attr.value); OZAttributeList attrs = db.getconfiguration(); foreach(stringdictionaryentry attr in attrs) Console.WriteLine(attr.Key + " : " + db.setconfiguration(attrs); FORCS Co., LTD 15
OZ API Developer's Guide (for.net) Constructor Summary Log(string url, string id, string pw, bool autologin, bool useusl) Method Summary string GetConfiguration() Stream DownloadLog() Stream DownloadLog(string filename) void SetConfiguration(string config) string[] GetFileNames() Constructor Detail ASP.NET public Log(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; 16 FORCS Co., LTD
Method Detail GetConfiguration public string GetConfiguration() throws OZAPIException. DownloadLog public stream DownloadLog() throws OZAPIException. public stream DownloadLog(string filename) throws OZAPIException. filename SetConfiguration public void SetConfiguration(string logs) throws OZAPIException. logs, "key=value" ex) string logs="priority=debug" ex) string logs="console.layout=%r[%t]%p%c1%x-%m%n GetFileNames public string[] GetFileNames() throws OZAPIException. Sample : LogSample.cs using System; using System.IO; using oz.framework.api; namespace sample /// <summary> /// LogTest FORCS Co., LTD 17
OZ API Developer's Guide (for.net) /// </summary> public class LogTest public static void Main() string url = "http://127.0.0.1/oz/server.aspx"; string id = "admin"; string password = "admin"; Log log = new Log(url, id, password, true, true); string config = log.getconfiguration(); Console.WriteLine(config); string[] logs = log.getfilenames(); foreach(string s in logs) Console.WriteLine(s); Stream logfile = log.downloadlog(); 18 FORCS Co., LTD
Constructor Summary Mail(String ip, int port, String id, String pw, bool bautologin, bool useusl) Mail(String url, String id, String pw, bool bautologin, bool useusl) Method Summary void AddAlias(String aliasname, NameValueCollection configmap) NameValueCollection GetAliasConfig(String aliasname) String[] GetMailAliasNames() void ModifyAlias(String aliasname, String newaliasname, NameValueCollection configmap) void RemoveAlias(String aliasname) void Send(String aliasname, String from, String fromusername, String to, String cc, String bcc, String subject, String context, bool ishtml, String localfilefullpath, String filename) bool SendSync(String aliasname, String from, String fromusername, String to, String cc, String bcc, String subject, String context, bool ishtml, String localfilefullpath, String filename) Constructor Detail //TCP/IP public Mail(String ip, int port, String id, String pw, bool bautologin, bool useusl) //HTTP public Mail(String url, String id, String pw, bool bautologin, bool useusl) HTTP URL url ex) String url = "http://127.0.0.1/oz/server"; FORCS Co., LTD 19
OZ API Developer's Guide (for.net) ip port id pw bautologin useusl TCP/IP IP ex) String ip = "127.0.0.1"; TCP/IP ex) int port = 8003; ex) String id = "admin"; ex) String pw = "admin"; ex) bool bautologin = true; USL ex) bool useusl = false; Method Detail AddAlias public void AddAlias(String aliasname, NameValueCollection configmap). aliasname configmap key "Option". GetAliasConfig public NameValueCollection GetAliasConfig(String aliasname). aliasname GetMailAliasNames public String[] GetMailAliasNames() mail.properties. : active. 20 FORCS Co., LTD
ModifyAlias public void ModifyAlias(String aliasname, String newaliasname, NameValueCollection configmap). aliasname newaliasname configmap key "Option". RemoveAlias public void RemoveAlias(String aliasname). aliasname Send public void Send(String aliasname, String from, String fromusername, String to, String cc, String bcc, String subject, String context, bool ishtml, String localfilefullpath, String filename). aliasname from fromusername to cc bcc subject context ishtml null "" null "", "," ";" null "", "," ";" HTML FORCS Co., LTD 21
OZ API Developer's Guide (for.net) localfilefullpath filename " " : " ". SendSync public bool SendSync(String aliasname, String from, String fromusername, String to, String cc, String bcc, String subject, String context, bool ishtml, String localfilefullpath, String filename). aliasname from fromusername to cc bcc subject context ishtml localfilefullpath filename null "" null "", "," ";" null "", "," ";" HTML " " : " ". Option 22 FORCS Co., LTD
Key Value active fromsend tosend SMTPServer true/false SMTP URL ex) setproperty("active", "true") ex) setproperty("fromsend", "mail@forcs.com") ex) setproperty("tosend", "mail@forcs.com") SMTP URL ex) setproperty("smtpserver", "mail.forcs.com") SMTPServerPort SMTP SMTP ex) setproperty("smtpserverport", "25") SMTPUserID SMTPUserPassword SMTPUserID_encrypted SMTPUserPassword_en crypted EnableSSL SendRetryCount SendRetryPeriodTime PrefixSubjectMessage SMTP ID SMTP ID SMTP ID SMTP ID true/false ( : ) SMTP ID ex) setproperty("smtpuserid", "UserID") SMTP ID ex) setproperty("smtpuserpassword", "Password") SMTP ID ex) setproperty("smtpuserid_encrypted", "ScPdRcRgFgHdEbJaJbPcFc") SMTP ex) setproperty("smtpuserpassword_encrypte d", "ScPdRcRgFgEbGaDbKbFbMaIbPa") SSL ex) setproperty("enablessl", "true") ex) setproperty("sendretrycount", "3") ex) setproperty("sendretryperiodtime", "10") ex) setproperty("prefixsubjectmessage", "[Forcs]") FORCS Co., LTD 23
OZ API Developer's Guide (for.net) Sample : MailSample.cs using System; using System.Collections.Specialized; using oz.framework.api; namespace OZServerAPI public class MailTest public static void Main() Mail mail = new Mail("127.0.0.1", 8005, "admin", "admin", true, false); NameValueCollection properties = new NameValueCollection(); properties["active"] = "true"; properties["fromsend"] = "forcs@forcs.com"; properties["tosend"] = "oz@forcs.com"; properties["smtpserver"] = "smtp.gmail.com"; properties["smtpserverport"] = "465"; properties["smtpuserid"] = "forcs@forcs.com"; properties["smtpuserpassword"] = "UserPassword"; properties["enablessl"] = "true"; mail.addalias("forcs", properties); mail.sendsync("forcs", "oz@forcs.com", "UserName", "oz@gmail.com", null, null, "This is test", false, @"d:\parameter_test.ozd", "test.ozd"); NameValueCollection props = mail.getaliasconfig("forcs"); mail.modifyalias("forcs", "forcs2", props); mail.addalias("forcs", props); mail.addalias("forcs3", props); mail.removealias("forcs3"); foreach(string name in mail.getmailaliasnames()) NameValueCollection properties2 = mail.getaliasconfig(name); foreach(string key in properties2.keys) Console.WriteLine(key + "=" + properties2[key]); Console.WriteLine(); 24 FORCS Co., LTD
FORCS Co., LTD 25
OZ API Developer's Guide (for.net) Constructor Summary Module(string url, string id, string pw, bool autologin, bool useusl) Method Summary Stream GetOZD(string item, string category, string[] urls) stream GetOZU(string item, string category, string[] urls) void AddODIParameter(string odiname, string key, string value) void AddODIParameter(string odiname, string item, string category, IDictionary parameters) void AddParameter(string key, string value) void AddApplicationParameter(string key, string value) void SaveOZD(string filename, string item, string category, string[] urls) void SaveOZU(string filename, string item, string category, string[] urls) public IReportInfo AddReport(string itemname, string categoryname) public IReportInfo AddReport(string itemname, string categoryname, String displayname) public Stream GetOZD() public void SaveOZD(string filename) Constructor Detail ASP.NET public Module(string url, string id, string pw, bool autologin, bool useusl) url id URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; 26 FORCS Co., LTD
pw autologin useusl ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; Method Detail GetOZD public stream GetOZD(string item, string category, string[] urls) throws OZAPIException SDM OZD. OZD urls. : API DM_TYPE="Memory", FetchType="Batch".. item ( OZR ) category urls OZD URL GetOZU public Stream GetOZU(String item, String category, String[] urls) throws OZAPIException SDM OZU. : API DM_TYPE="Memory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". item category urls ( OZA ) OZU URL AddODIParameter FORCS Co., LTD 27
OZ API Developer's Guide (for.net) public void AddODIParameter(string odiname, string key, string value) throws OZAPIException SDM ODI ODI. ODI ODI. odiname key value ODI ODI ODI AddODIParameter public void AddODIParameter(string odiname, string item, string category, IDictionary parameters) throws OZAPIException SDM ODI ODI. ODI ODI. ODI SDM SDM. odiname item category parameters ODI ODI ODI Key, Value Dictionary : OZU parameters 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) throws OZAPIException SDM.. 28 FORCS Co., LTD
key value AddApplicationParameter public void AddApplicationParameter(string key, string value) throws OZAPIException SDM. ODI ODI ODI. key ODI value ODI SaveOZD public void SaveOZD(string filename, string item, string category, string[] urls) throws OZAPIException 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 OZAPIException OZU. : API DM_TYPE="Momory", FetchType="Batch".. : "FetchUnit" "DM_PER_DATAMODULE". filename OZU FORCS Co., LTD 29
OZ API Developer's Guide (for.net) item category Urls (.oza) (.oza) OZU URL AddReport public IReportInfo AddReport(string itemname, string categoryname) OZD. itemname categoryname public IReportInfo AddReport(string itemname, string categoryname, String displayname) OZD. itemname categoryname displayname GetOZD public Stream GetOZD() OZD. SaveOZD public void SaveOZD(string filename) OZD OZD. filename Interface IReportInfo(oz.framework.api.IReportInfo) OZD. ItemName string ItemNameget;. 30 FORCS Co., LTD
CategoryName string CategoryNameget;. AddURL void AddURL(params string[] urls) URL. urls URL AddParameter 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 AddProperties public void AddProperties(string key, string value). key value key "Option". Sample : ModuleSample.cs using System; using System.IO; using System.Collections; FORCS Co., LTD 31
OZ API Developer's Guide (for.net) using oz.framework.api; namespace sample /// <summary> /// /// ModuleTest - Before start /// You need to customize parameters to run in your environment /// We don't provide oza, odi file for the test /// </summary> public class ModuleTest public static void Main() string url = "http://127.0.0.1/oz/server.aspx"; string id = "admin"; string password = "admin"; true); Module m = new Module(url, id, password, true, IDictionary parameters = new Hashtable(); parameters["rowcount"] = "10000"; m.addodiparameter(" 100.odi", ".oza", "/", parameters); " 100 "); m.addapplicationparameter("odi.odinames", m.addapplicationparameter("odi. 100.pcount", "1"); m.addapplicationparameter("odi. 100.args1", "rowcount=10000"); "/"); Stream ozufile = m.getozu(".oza", m = new Module(url, id, password, true, true); m.addodiparameter("parameter_test.odi", "odiparam", "this is odi parameter"); m.addodiparameter("parameter_test.odi", "odiparam2", "this is parameter 2"); m.addparameter( "formparam", "this is form parameter"); Stream s = m.getozd("parameter_test.ozr", "/", "http://127.0.0.1/img/test.gif"); 32 FORCS Co., LTD
Sample : MultiReportSample.cs using System; using oz.framework.api; namespace sample public class MultiReportSample public static void Main() Module maker = new Module("http://127.0.0.1/oz/server.aspx", "admin", "admin", true, false); string[] urls = new string[]"file://d:\\pictures\\0.gif", "file://d:\\pictures\\1.gif", "file://d:\\pictures\\2.gif"; maker.addodiparameter("parameter_test.odi", "odiparam", "testvalue"); maker.addparameter("formparam", "testvalue"); IReportInfo reportinfo = maker.addreport("parameter_test1.ozr", "/", "Report1"); reportinfo.addurl(urls); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 1"); reportinfo.addparameter("formparam", "form parameter 1"); reportinfo = maker.addreport("parameter_test2.ozr", "/", "Report2"); reportinfo.addurl(urls); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 2"); reportinfo.addparameter("formparam", "form parameter 2"); reportinfo = maker.addreport("parameter_test3.ozr", "/", "Report3"); reportinfo.addurl(urls); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 3"); reportinfo.addparameter("formparam", "form parameter 3"); maker.saveozd(@"d:\multireport.ozd"); UseOzdParameterSample.cs using System; using oz.framework.api; FORCS Co., LTD 33
OZ API Developer's Guide (for.net) namespace sample public class CreateMultiFormOZD public static void Main() Module maker = new Module("http://127.0.0.1/oz50/server.aspx", "admin", "admin", true, false); maker.addodiparameter("parameter_test.odi", "odiparam", "testvalue"); maker.addparameter("formparam", "testvalue"); IReportInfo reportinfo = maker.addreport("parameter_test.ozr", "/"); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 1"); reportinfo.addparameter("formparam", "form parameter 1"); reportinfo.addproperties("use_ozd_parameter", "false"); reportinfo = maker.addreport("parameter_test.ozr", "/"); reportinfo.addodiparameter("parameter_test.odi", "odiparam", "form number 2"); reportinfo.addparameter("formparam", "form parameter 2"); reportinfo.addproperties("use_ozd_parameter", "false"); maker.addreport("sample.ozr", "/"); maker.saveozd(@"d:\sample.ozd"); 34 FORCS Co., LTD
Constructor Summary Monitor(string ip, int port, string id, string pw, bool autologin, bool useusl) Monitor (string url, string id, string pw, bool autologin, bool useusl) Method Summary OZServerInfo GetServerInfo() MemoryStatus GetMemoryInfo() Stream DownloadLog() Constructor Detail ASP.NET public Monitor(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; Method Detail FORCS Co., LTD 35
OZ API Developer's Guide (for.net) GetServerInfo public OZServerInfo GetServerInfo() throws OZPAIException. GetMemoryInfo public MemoryStatus GetMemoryInfo() throws OZAPIException (,, ). DownloadLog rototype public stream DownloadLog() throws OZAPIException. Class MemoryStatus(oz.server.monitor.MemoryStatus) Server System. OZServerInfo(oz.server.monitor. OZServerInfo) Server Server System. - public string osname : Server OS public string osversion : Server OS public string FrameworkVersion : Server.NET Framework Version public string ServerVersion : public string ReleaseNumber : OZ Common Protocol public int ProtocolNumber : OZ Common Protocol public string DataModuleReleaseNumber : OZ Data Module Sample : MonitorSample.cs using System; 36 FORCS Co., LTD
using oz.util; using oz.framework.api; using oz.framework.monitor; namespace sample /// <summary> /// MonitorTest /// </summary> public class MonitorTest public static void Main() string url = "http://127.0.0.1/oz/server.aspx"; string id = "admin"; string password = "admin"; true); Monitor m = new Monitor(url, id, password, true, OZServerInfo si = m.getserverinfo(); Console.WriteLine(si); MemoryStatus ms = m.getmemoryinfo(); Console.WriteLine(ms); System.IO.Stream monitorlog = m.downloadlog(); FORCS Co., LTD 37
OZ API Developer's Guide (for.net) Constructor Summary Repository(string url, string id, string pw, bool autologin, bool useusl) Method Summary // Configuration public void SetConfigration(OZAttributeList config) public OZAttributeList GetConfiguration() // User public int CreateUser(string username, string pwd, int groupid, string description) public void DeleteUser(int userid) public void UpdateUserName(int userid, string username) public string GetUserName(int userid) // UserLogin public void DisableLogin(string username) public void UpdateLoginDefault(int value) public void EnableLogin(string username) public void Logout(int userid) public bool IsLoggedIn(int userid) // UserPwd public bool CheckPassword(int userid, string password) public void UpdatePassword(int userid, string password) // UserDesc public void UpdateUserDescription(int userid, string description) public string GetUserDescription(int userid) 38 FORCS Co., LTD
// UserID public int GetGroupID(int userid) public int GetUserID(string username) public void UpdateGroupID(int groupid, int userid) // UserList public OZRepositoryUser[] GetUserInfos() public OZRepositoryUser[] GetUserInfos(int groupid) public OZRepositoryUser[] GetUserInfosOfItem(int itemid, byte Permission) public OZRepositoryUser[] GetUserInfosOfCategory(int categoryid, byte Permission) // Group public OZRepositoryUser[] GetUserInfosOfCategory(int categoryid, byte Permission) public int CreateGroup(string groupname, int parentgroupid) public int CreateGroup(string name, int parentgroupid, string description) public void DeleteGroup(int groupid) public void UpdateParentGroup(int groupid, int parentgroupid) public void UpdateGroupName(int groupid, string groupname) // GroupAdmin public void UpdateGroupAdministrator(int userid, int groupid) public bool IsGroupAdministrator(int userid, int groupid) // GroupList public OZRepositoryGroup[] GetChildGroupInfos(int groupid) public OZRepositoryGroup[] GetSubGroupInfos(int groupid) public OZRepositoryGroup GetGroupInfo(int groupid) public OZRepositoryGroup[] GetGroupInfosOfItem(int itemid, byte Permission) public OZRepositoryGroup[] GetGroupInfosOfCategory(int categoryid, byte Permission) // Item FORCS Co., LTD 39
OZ API Developer's Guide (for.net) public int CreateItem(string name, OZItemType type, string description, int categoryid, Stream itemdata) public int CreateItem(string name, OZItemType type, string description, string categoryname, Stream itemdata) public int GetItemID(string name, OZItemType type, int categoryid) public int GetItemID(string name, OZItemType type, string categoryname) public void DeleteItem(int id) public Stream GetItem(int id, int categoryid) public void UpdateItemName(int itemid, string itemname) public string GetItemPath(int itemid) public Stream GetItemDirectly(string name, OZItemType type, string categoryname) public Stream GetItemDirectly(string name, OZItemType type, string categoryname, bool compressed) public void UpdateItem(int id, Stream itemdata) public void UpdateItemDirectly(string name, OZItemType type, string categoryname, Stream itemdata) public bool HasItem(string name, OZItemType type, string categoryname) // InfoByItem public int GetCategoryID(int itemid) public void UpdateCategoryID(int categoryid, int newcategoryid, int itemid) // ItemList public OZRepositoryItem[] GetItemInfos() public OZRepositoryItem GetItemInfo(int id) public OZRepositoryItem[] GetItemInfos(int categoryid) public OZRepositoryItem[] GetItemInfos(string categoryname) public OZRepositoryItem[] GetItemInfos(int categoryid, int userid, byte Permission) public OZRepositoryItem[] GetItemInfos(string categoryname, int userid, byte Permission) public OZRepositoryItem[] GetItemInfosOfGroup(int categoryid, int groupid, byte Permission) public OZRepositoryItem[] GetItemInfosOfGroup(string categoryname, int 40 FORCS Co., LTD
groupid, byte Permission) public OZRepositoryItem[] GetItemInfosOfUser(int userid, byte Permission) public OZRepositoryItem[] GetItemInfosOfGroup(int groupid, byte Permission) // Category public int CreateCategory(string name, int parentcategoryid) public int CreateCategory(string categorypath) public void DeleteCategory(int id) public int GetCategoryID(string fullpath) public void UpdateParentCategory(int id, int parentcategoryid) public void UpdateCategoryName(int id, string name) public int GetItemCount(int categoryid) public OZRepositoryCategory[] GetCategoryInfos(int id) public OZRepositoryCategory[] GetCategoryInfosOfUser(int id, int userid, byte Permission) public OZRepositoryCategory[] GetCategoryInfosOfGroup(int id, int groupid, byte Permission) public OZRepositoryCategory GetCategoryInfo(int id) // CheckInOut public void CheckOut(int itemid, int userid, string checkoutfolder) public bool UndoCheckOutItem(int itemid, int userid) public bool CheckInItem(bool keepcheckout, int itemid, int userid, Stream itemdata) public bool IsCheckOutUser(int itemid, int userid) // History public void RollBackItem(int itemid, int itemversion) public Stream GetItemByVersion(int id, int version) public OZRepositoryHistory[] GetHistoryInfos(int itemid) public void ClearHistory(int itemid, int version) Constructor Detail FORCS Co., LTD 41
OZ API Developer's Guide (for.net) ASP.NET public Repository(string url, string id, string pw, bool autologin, bool useusl) url id pw autologin useusl URL ex) string url = "http://127.0.0.1/oz/server.aspx"; ex) string id = "admin"; ex) string pw = "admin"; ex) bool autologin = true; USL ex) bool useusl = false; Method Detail // Configuration SetConfiguration public void SetConfiguration(OZAttributeList config) throws OZAPIException Repository. Repository,, valid %OZ_HOME%conf /repository.properties. config GetConfiguration public OZAttributeList GetConfiguration() throws OZAPIException Repository. Repository,, valid %OZ_HOME%conf/repository.properties. - Key SetConfiguration() GetConfiguration() key. 42 FORCS Co., LTD
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 password, int groupid, string description) throws OZAPIException,,,, userid return. username password groupid description ID DeleteUser public void DeleteUser(int userid) throws OZAPIException ID. userid ID UpdateUserName FORCS Co., LTD 43
OZ API Developer's Guide (for.net) public void UpdateUserName(int userid, string username) throws OZAPIException ID. userid username ID GetUserName public string GetUserName(int userid) throws OZAPIException ID. userid ID // UserLogin DisableLogin public void DisableLogin(string username) throws OZAPIException. username UpdateLoginDefault public void UpdateLoginDefault(int value) throws OZAPIException ID. value ID EnableUserLogin public void EnableUserLogin(string username) throws OZAPIException. username Logout public void Logout(int userid) throws OZAPIException ID,. userid ID 44 FORCS Co., LTD
IsLoggedIn public bool IsLoggedIn(int userid) throws OZAPIException ID,. userid ID // UserPwd CheckPassword public bool CheckPassword(int userid, string password) throws OZAPIException. userid password ID UpdatePassword public void UpdatePassword(int userid, string password) throws OZAPIException ID. userid password ID // UserDesc UpdateUserDescription public void UpdateUserDescription(int userid, string description) throws OZAPIException ID. userid description ID GetUserDescription public string GetUserDescription(int userid) throws OZAPIException ID. userid ID // UserID FORCS Co., LTD 45
OZ API Developer's Guide (for.net) GetGroupID public int GetGroupID(int userid) throws OZAPIException ID ID. userid ID ID GetUserID public int GetUserID(string username) throws OZAPIException ID. username ID UpdateGroupID public void UpdateGroupID(int groupid, int userid) throws OZAPIException ID. groupid userid ID ID ID // UserList GetUserInfos public OZRepositoryUser[] GetUserInfos() throws OZAPIException OZRepositoryUser. GetUserInfos public OZRepositoryUser[] GetUserInfos(int groupid) throws OZAPIException ID. groupid ID GetUserInfosOfItem public OZRepositoryUser[] GetUserInfosOfItem(int itemid, byte permission) throws OZAPIException ID Permission. itemid ID 46 FORCS Co., LTD
permission GetUserInfosOfCategory public OZRepositoryUser[] GetUserInfosOfCategory(int categoryid, byte permission) throws OZAPIException ID Permission. categoryid permission ID // Group CreateGroup public int CreateGroup(string groupname, int parentgroupid) throws OZAPIException, ID. groupname parentgroupid ID DeleteGroup public void DeleteGroup(int groupid) throws OZAPIException ID. groupid ID UpdateParentGroup public void UpdateParentGroup(int groupid, int parentgroupid) throws OZAPIException ID. groupid ID parentgroupid UpdateGroupName public void UpdateGroupName(int groupid, string groupname) throws OZAPIException ID. groupid groupname ID FORCS Co., LTD 47
OZ API Developer's Guide (for.net) // GroupAdmin UpdateUserGroupAdmin public void UpdateGroupAdministrator(int userid, int groupid) throws OZAPIException ID. userid groupid ID ID IsGroupAdministrator public bool IsGroupAdministrator(int userid, int groupid) throws OZAPIException ID. userid ID groupid ID // GroupList GetChildGroupInfos public OZRepositoryGroup[] GetChildGroupInfos(int groupid) throws OZAPIException ID. groupid ID GetSubGroupInfos public OZRepositoryGroup[] GetSubGroupInfos(int groupid) throws OZAPIException ID. (not recursively) groupid ID GetGroupInfo public OZRepositoryGroup GetGroupInfo(int groupid) throws OZAPIException ID. groupid ID GetGroupInfosOfItem 48 FORCS Co., LTD
public OZRepositoryGroup[] GetGroupInfosOfItem(int itemid, byte permission) throws OZAPIException ID permission. itemid ID permission GetGroupInfosOfCategory public OZRepositoryGroup[] GetGroupInfosOfCategory(int categoryid, byte permission) throws OZAPIException ID Permission. categoryid permission ID // Item CreateItem public int CreateItem(string itemname, OZItemType itemtype, string itemdescription, int categoryid, Stream itemdata) throwcs OZAPIException public int CreateItem(string itemname, OZItemType itemtype, string itemdescription, string categoryname, Stream itemdata) throwcs OZAPIException,, desc. ID,,, item ID. itemname itemtype itemdescription categoryid itemdata categoryname ID GetItemId FORCS Co., LTD 49
OZ API Developer's Guide (for.net) public int GetItemID(string itemname, OZItemType itemtype, int categoryid) throwcs OZAPIException public int GetItemID(string itemname, OZItemType itemtype, string categoryname) throwcs OZAPIException,, ID ID. ItemType OZItemInfo. itemname itemtype categoryid categoryname ID DeleteItem public void DeleteItem(int itemid) throws OZAPIException. itemid ID GetItem public Stream GetItem(int itemid) throws OZAPIException ID. itemid ID UpdateItemName public void UpdateItemName(int itemid, string itemname) throws OZAPIException ID. itemid itemname ID GetItemDirectly public Stream GetItemDirectly(string itemname, OZItemType itemtype, string categoryname) throws OZAPIException public Stream GetItemDirectly(string itemname, OZItemType itemtype, string categoryname, bool compresseditem) throws OZAPIException 50 FORCS Co., LTD
. itemname itemtype categoryname compresseditem UpdateItem public void UpdateItem(int itemid, stream itemdata) throws OZAPIException ID. itemid itemdata ID UpdateItemDirectly public void UpdateItemDirectly(string itemname, OZItemType itemtype, string categoryname, Stream itemdata) throws OZAPIException ID. itemname itemtype categoryname itemdata HasItem public bool HasItem(string itemname, OZItemType itemtype, string categoryname) throws OZAPIException. itemname itemtype categoryname // InfoByItem GetCategoryID public int GetCategoryID(int itemid) throws OZAPIException ID ID. itemid ID FORCS Co., LTD 51
OZ API Developer's Guide (for.net) UpdateCategoryID public void UpdateCategoryID(int categoryid, int newcategoryid, int itemid) throws OZAPIException ID. categoryid ID newcategoryid ID itemid ID // ItemList GetItemInfos public OZRepositoryItem[] GetItemInfos() throws OZAPIException. GetItemInfo public OZRepositoryItem GetItemInfo(int itemid) throws OZAPIException ID. itemid ID GetItemInfos public OZRepositoryItem[] GetItemInfos(int categoryid) throws OZAPIException public OZRepositoryItem[] GetItemInfos(string categoryfullpath) throws OZAPIException public OZRepositoryItem[] GetItemInfos(int categoryid, int userid, byte permission) throws OZAPIException public OZRepositoryItem[] GetItemInfos(string categoryfullpath, int userid, byte permission) throws OZAPIException. categoryid categoryfullpath userid permission ID ID 52 FORCS Co., LTD
GetItemInfosOfGroup public OZRepositoryItem[] GetItemInfosOfGroup(int categoryid, int groupid, byte Permission) throws OZAPIException public OZRepositoryItem[] GetItemInfosOfGroup(string categoryfullpath, int groupid, byte permission) throws OZAPIException. categoryid groupid permission categoryfullpath ID ID GetItemInfosOfUser public OZRepositoryItem[] GetItemInfosOfUser(int userid, byte permission) throws OZAPIException ID Permission. userid permission ID GetItemInfosOfGroup public OZRepositoryItem[] GetItemInfosOfGroup(int groupid, byte permission) throws OZAPIException ID Permission. groupid permission ID // Category CreateCategory public int CreateCategory(string categoryname, int parentcategoryid) throws OZAPIException, ID. categoryname parentcategoryid ID FORCS Co., LTD 53
OZ API Developer's Guide (for.net) CreateCategory public int CreateCategory(string categorypath) throws OZAPIException, ID. categorypath DeleteCategory public void DeleteCategory(int categoryid) throws OZAPIException ID. categoryid ID GetCategoryID public int GetCategoryID(string fullpath) throws OZAPIException ID. fullpath ID UpdateParentCategory public void UpdateParentCategory(int categoryid, int parentcategoryid) throws OZAPIException ID. categoryid parentcategoryid ID ID UpdateCategoryName public void UpdateCategoryName(int categoryid, string categoryname) throws OZAPIException ID. categoryid categoryname ID GetItemCount public int GetItemCount(int categoryid) throws OZAPIException 54 FORCS Co., LTD
. categoryid ID GetCategoryInfos public OZRepositoryCategory[] GetCategoryInfos(int categoryid) throws OZAPIException. categoryid ID GetCategoryInfo public OZRepositoryCategory GetCategoryInfo(int categoryid) throws OZAPIException. categoryid ID GetCategoryInfosOfUser public OZRepositoryCategory[] GetCategoryInfosOfUser(int categoryid, int userid, byte Permission) throws OZAPIException ID permission. userid categoryid Permission ID ID GetCategoryInfosOfGroup public OZRepositoryCategory[] GetCategoryInfosOfGroup(int groupid, int categorypid, byte permission) throws OZAPIException ID permission. groupid categoryid permission ID ID // CheckInOut CheckOut FORCS Co., LTD 55
OZ API Developer's Guide (for.net) public void CheckOut(int itemid, int userid, string checkoutfolder) throws OZAPIException ID. itemid userid checkoutfolder ID ID UndoCheckOut public void UndoCheckOut(int itemid, int userid) throws OZAPIException ID. itemid userid ID ID CheckIn public void CheckIn(bool keepchkout, int itemid, int userid, stream itemdata) throws OZAPIException ID. keepchkout itemid userid itemdata ID ID IsCheckOutUser public bool IsCheckOutUser(int itemid, int userid) throws OZAPIException. itemid userid ID ID // History GetItemByVersion public Stream GetItemByVersion(int itemid, int itemversion) throws OZAPIException ID. itemid ID 56 FORCS Co., LTD
itemversion GetHistoryInfos public OZRepositoryHistory[] GetHistoryInfos(int itemid) throws OZAPIException. itemid ID ClearHistory public void ClearHistory(int itemid, int itemversion) throws OZAPIException. itemid itemversion ID RollBack public void RollBack(int itemid, int itemversion) throws OZAPIException. itemid itemversion ID Class OZRepositoryUser(oz.framework.repository.OZRepositoryUser),,,,. - Name public string Nameget; ID public int IDget; ID FORCS Co., LTD 57
OZ API Developer's Guide (for.net) GroupList public System.Collections.IList GroupList get; Description public string Descriptionget; PassWord public string PassWordget; Permission public byte Permissionget; 0 : None( ) 1 : View( ) 3 : Read( ) 7 : Write( ) DirectPermission public byte DirectPermissionget; InDirectPermission public byte InDirectPermissionget; IsLoggedIn public bool IsLoggedInget; SessionID public int SessionIDget; 58 FORCS Co., LTD
ID IsLoginEnabled public bool IsLoginEnabledget; OZRepositoryGroup(oz.framework.repository.OZRepositoryGroup),,,,. - Name public string Nameget; ID public int IDget; ID ParentID public int ParentIDget; ID GroupAdmininistratorList public System.Collections.IList GroupAdministratorList get; DirectPermission public byte DirectPermissionget; InDirectPermission public byte InDirectPermissionget; FORCS Co., LTD 59
OZ API Developer's Guide (for.net) Permission public byte Permissionget; Description public string Descriptionget; FullPath public string FullPathget; OZRepositoryItem(oz.framework.repository.OZRepositoryItem),,,,. - Name public string Nameget; ID public int IDget; ID Type public OZItemType Typeget; enum OZItemType ODI, OZR, SDM, USDM, OZD, IMG Description public string Descriptionget; CheckOutUserID public int CheckOutUserIDget; 60 FORCS Co., LTD
ID CheckOutUserName public string CheckOutUserNameget; CheckOutFolder public string CheckOutFolderget; UpdateTime public string UpdateTimeget; IsCheckedOut public bool IsCheckedOutget; DirectPermission public byte DirectPermissionget; InDirectPermission public byte InDirectPermissionget; AdministratorList public System.Collections.IList AdministratorListget; CategoryList System.Collections.IList CategoryListget; OZRepositoryCategory(oz.framework.repository.OZRepositoryCategory) FORCS Co., LTD 61
OZ API Developer's Guide (for.net). - Name public string Nameget; ID public int IDget; ID ParentID public int ParentIDget; ID CategoryAdministratorList public System.Collections.IList CategoryAdministratorList get; DirectPermission public byte DirectPermissionget; InDirectPermission public byte InDirectPermissionget; Permission public byte Permissionget; Description public string Descriptionget; 62 FORCS Co., LTD
FullPath public string FullPathget; OZRepositoryHistory(oz.framework.repository.OZRepositoryHistory). - ItemPath public string ItemPathget; ItemVersion public int ItemVersionget; Date public string Dateget; CheckInUser public string CheckInUserget; Sample : RepositorySample.cs using System; using System.IO; using System.Reflection; using System.Collections; using oz.util; using oz.framework.api; using oz.framework.repository; namespace sample /// <summary> /// RepositoryTest /// FORCS Co., LTD 63
OZ API Developer's Guide (for.net) /// Before start /// You should modify file open logic. /// In this sample we handle project resource whose id is "sample.parameter_test.odi" /// as a file to upload /// </summary> public class RepositoryTest private static Repository s_repository = null; public static void Main() string url = "http://127.0.0.1/oz/server.aspx"; string id = "admin"; string password = "admin"; s_repository = new Repository(url, id, password, true, true); repositoryconfiguration(); categorytest(); itemtest(); grouptest(); usertest(); private static void repositoryconfiguration() OZAttributeList attrs = s_repository.getconfiguration(); Console.WriteLine(attrs); s_repository.setconfiguration(attrs); private static void historytest(int itemid) const int version = 0; // you can store item using this input stream Stream input = s_repository.getitembyversion(itemid, version); OZRepositoryHistory[] historyinfos = s_repository.gethistoryinfos(itemid); foreach(ozrepositoryhistory history in historyinfos) Console.WriteLine(history); s_repository.rollback(itemid, version); private static void checkinouttest(int itemid) int userid = s_repository.getuserid("admin"); string checkoutfolder = "."; s_repository.checkout(itemid, userid, checkoutfolder); 64 FORCS Co., LTD
s_repository.undocheckout(itemid, userid); s_repository.checkout(itemid, userid, checkoutfolder); Assembly asm = Assembly.GetExecutingAssembly(); Stream item = asm.getmanifestresourcestream ("sample.parameter_test.odi"); try s_repository.checkin(false, itemid, userid, item); finally item.close(); private static void categorytest() int userid = s_repository.getuserid("admin"); int groupid = s_repository.getgroupid(userid); int categoryid = s_repository.createcategory("/poultry"); Console.WriteLine("Created category : 0", categoryid); int childcategoryid = s_repository.createcategory("chickens", cat egoryid); Console.WriteLine("Created child category : 0", childcategoryid); s_repository.deletecategory(childcategoryid); s_repository.updatecategoryname(categoryid, "Fishes"); int anothercategoryid = s_repository.createcategory("/category Test"); s_repository.updateparentcategory(categoryid, anothercategoryid); Console.WriteLine("Item count in category [0] : 1", categoryid, s_repository.getitemcount(categoryid)); OZRepositoryCategory[] categoryinfos = s_repository.getcategoryinfos(anothercategoryid); foreach(ozrepositorycategory category in categoryinfos) Console.WriteLine(category); categoryinfos = s_repository.getcategoryinfosofuser(anothercategoryid, userid, 2); foreach(ozrepositorycategory category in categoryinfos) Console.WriteLine(category); s_repository.deletecategory(categoryid); s_repository.deletecategory(anothercategoryid); FORCS Co., LTD 65
OZ API Developer's Guide (for.net) private static void itemlisttest(int itemid) int userid = s_repository.getuserid("admin"); int groupid = s_repository.getgroupid(userid); string categoryname = "/"; int categoryid = s_repository.getcategoryid(categoryname); OZRepositoryItem iteminfo = s_repository.getiteminfo(itemid); Console.WriteLine(itemInfo); OZRepositoryItem[] iteminfos = s_repository.getiteminfos(categoryid); foreach(ozrepositoryitem ii in iteminfos) Console.WriteLine(ii); iteminfos = s_repository.getiteminfos(categoryname, userid, 2); foreach(ozrepositoryitem ii in iteminfos) Console.WriteLine(ii); 2); iteminfos = s_repository.getiteminfosofgroup(categoryname, groupid, foreach(ozrepositoryitem ii in iteminfos) Console.WriteLine(ii); private static void itemtest() string itemname = "api test.odi"; string categoryname = "/api test"; string description = "item upload test"; int categoryid = s_repository.createcategory(categoryname); Stream item = Assembly.GetExecutingAssembly().GetManifestResourceStream ("sample.parameter_test.odi"); int itemid; try itemid = s_repository.createitem(itemname, OZItemType.ODI, description, categoryid, item); Console.WriteLine("Item uploaded : 0", itemid); finally item.close(); itemname = "Changed item name.odi"; s_repository.updateitemname(itemid, itemname); Console.WriteLine("Changed item name : 0", s_repository.getiteminfo(itemid).name); itemlisttest(itemid); 66 FORCS Co., LTD
checkinouttest(itemid); categorytest(); historytest(itemid); s_repository.deleteitem(itemid); s_repository.deletecategory(categoryid); private static void grouplisttest(int gropuid) int userid = s_repository.getuserid("admin"); int groupid = s_repository.getgroupid(userid); OZRepositoryGroup gi= s_repository.getgroupinfo(groupid); Console.WriteLine(gi); private static void groupadministratortest(int groupid) IList admins = s_repository.getgroupinfo(groupid).groupadministratorlist; Console.WriteLine(admins[0].ToString()); int userid = s_repository.createuser("test id", "1234567", groupid, ""); s_repository.updategroupadministrator(userid, groupid); admins = s_repository.getgroupinfo(groupid).groupadministratorlist; Console.WriteLine(admins[0].ToString()); s_repository.deleteuser(userid); private static void grouptest() int adminid = s_repository.getuserid("admin"); int rootgroupid = s_repository.getgroupid(adminid); string groupname = "forcs"; int groupid = s_repository.creategroup(groupname, rootgroupid, "test group"); rootgroupid); int tempgroupid = s_repository.creategroup("temporary group", s_repository.updateparentgroup(groupid, tempgroupid); s_repository.updateparentgroup(groupid, rootgroupid); s_repository.deletegroup(tempgroupid); s_repository.updategroupname(groupid, "OZ XStudio"); groupadministratortest(groupid); grouplisttest(groupid); s_repository.deletegroup(groupid); FORCS Co., LTD 67
OZ API Developer's Guide (for.net) private static void usertest() string username = "forcs"; string password = "111111"; string description = "test account"; int groupid = s_repository.getgroupid(s_repository.getuserid("admin")); int userid = s_repository.createuser(username, password, groupid, description); prevgroupid); int prevgroupid = s_repository.getgroupid(userid); int newgroupid = s_repository.creategroup("group for test", s_repository.updategroupid(newgroupid, userid); username = s_repository.getusername(userid); s_repository.updategroupid(prevgroupid, userid); s_repository.deletegroup(newgroupid); description = s_repository.getuserdescription(userid); Console.WriteLine("Password matches? " + s_repository.checkpassword(userid, "new password")); s_repository.updatepassword(userid, "new password"); Console.WriteLine("Password matches? " + s_repository.checkpassword(userid, "new password")); s_repository.updatelogindefault(userid); username = s_repository.getusername(userid); s_repository.disablelogin(username); s_repository.enablelogin(username); int categoryid = s_repository.createcategory("/user list test"); OZRepositoryUser[] userinfos = s_repository.getuserinfos(); foreach(ozrepositoryuser ui in userinfos) Console.WriteLine(ui); userinfos = s_repository.getuserinfos(groupid); foreach(ozrepositoryuser ui in userinfos) Console.WriteLine(ui); 68 FORCS Co., LTD
s_repository.deletecategory(categoryid); s_repository.deleteuser(userid); FORCS Co., LTD 69
OZ API Developer's Guide (for.net) 70 FORCS Co., LTD
API Class Program Class Publisher Class Scheduler Class TaskHolidayInfo Class TaskHolidayGroupInfo FORCS Co., LTD 71
OZ API Developer's Guide (for.net) API. API. Program Publisher Scheduler TaskHolidayInfo TaskHolidayGroupInf o..... API bin. OZServer.NET.dll OZSchedulerAPI.dll. API. 72 FORCS Co., LTD
Constructor Summary Program(string ip, int port) Method Summary void CreateFolder(ServerInfo s, string folder) Stream DownloadFile(ServerInfo s, string file) FileInfo[] GetExternalProgramInfos(ServerInfo s, string folder) void RemoveFiles(ServerInfo s, string folder, string[] files) void RemoveFolder(ServerInfo s, string folder, bool forciblyremove) void UploadFile(ServerInfo s, string file, Stream inputstream) Constructor Detail public Program(string ip, int port) ip port IP ex) string ip = "127.0.0.1"; ( : 9521) ex) int port = 9521; Method Detail CreateFolder public void CreateFolder(ServerInfo s, string folder). s folder FORCS Co., LTD 73
OZ API Developer's Guide (for.net) DownloadFile public Stream DownloadFile(ServerInfo s, string file). s file GetExternalProgramInfos public FileInfo[] GetExternalProgramInfos(ServerInfo s, string folder). s folder RemoveFiles public void RemoveFiles(ServerInfo s, string folder, string[] files). s folder files RemoveFolder public void RemoveFolder(ServerInfo s, string folder, bool forciblyremove). s folder forciblyremove true : false : UploadFile public void UploadFile(ServerInfo s, string file, Stream inputstream) (). 74 FORCS Co., LTD
s file inputstream Class ServerInfo(oz.scheduler.ServerInfo). - IsDaemon public bool IsDaemonget;set; true : TCP/IP false : HTTP IP public string IPget;set; IP Server TCP/IP. Port public int Portget;set; Port Server TCP/IP. URL public string URLget;set; URL Server HTTP. ID public string IDget;set; ID Password public string Passwordget;set; FORCS Co., LTD 75
OZ API Developer's Guide (for.net) FileInfo(oz.scheduler.FileInfo) (/,,, ). - IsDirectory public bool IsDirectoryget;set; () Name public string Nameget;set; Size public long Sizeget;set; LastModified public DateTime LastModifiedget;set;, 1970 1 1 00:00:00 GMT Sample : ProgramSample.cs using System; namespace ProgramSample public class Program public static void Main() oz.framework.api.program program = new oz.framework.api.program("127.0.0.1", 9521); oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; 76 FORCS Co., LTD
serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.url = "http://127.0.0.1/oz/server.aspx"; serverinfo.id = "admin"; serverinfo.password = "admin"; serverinfo.usertype = oz.scheduler.usertype.administrator; program.createfolder(serverinfo, "/folder"); byte[500]); System.IO.MemoryStream inputstream = new System.IO.MemoryStream(new program.uploadfile(serverinfo, "/folder/file1", inputstream); inputstream.position = 0; program.uploadfile(serverinfo, "/folder/file2", inputstream); System.IO.Stream downloadedfile = program.downloadfile(serverinfo, "/folder/file1"); if(downloadedfile.length!= inputstream.length) throw new InvalidOperationException("Invalid program status. Binary data has modified by outside. "); oz.scheduler.fileinfo[] extproginfos = program.getexternalprograminfos(serverinfo, "folder"); foreach(oz.scheduler.fileinfo extproginfo in extproginfos) Console.WriteLine("IsDirectory : " + extproginfo.isdirectory); Console.WriteLine("LastModified : " + extproginfo.lastmodified); Console.WriteLine("Name : " + extproginfo.name); Console.WriteLine("Size : " + extproginfo.size); program.removefiles(serverinfo, "/folder", "file1", "file2"); program.removefolder(serverinfo, "/folder", true); FORCS Co., LTD 77
OZ API Developer's Guide (for.net) Constructor Summary Publisher(string ip, int port) Method Summary void CreateFolder(ServerInfo s, string folder) Stream DownloadFile(ServerInfo s, string file) FileInfo[] GetPublishedInfos(ServerInfo s, string folder) void RemoveFiles(ServerInfo s, string folder, string[] files) void RemoveFolder(ServerInfo s, string folder, bool forciblyremove) Constructor Detail public Publisher(string ip, int port) ip port IP ex) string ip = "127.0.0.1"; ( : 9521) ex) int port = 9521; Method Detail CreateFolder public void CreateFolder(ServerInfo s, string folder). s folder DownloadFile 78 FORCS Co., LTD
public Stream DownloadFile(ServerInfo s, string file). s file GetPublishedInfos public FileInfo[] GetPublishedInfos(ServerInfo s, string folder). s folder RemoveFiles public void RemoveFiles(ServerInfo s, string folder, string[] files). s folder fiels RemoveFolder public void RemoveFolder(ServerInfo s, string folder, bool forciblyremove). s folder forciblyremove true : false : Class ServerInfo(oz.scheduler.ServerInfo) Program class " class". FORCS Co., LTD 79
OZ API Developer's Guide (for.net) FileInfo(oz. scheduler.fileinfo) Program class " class". Sample : PublisherSample.cs using System; namespace PublisherSample public class Publisher public static void Main() oz.framework.api.publisher publisher = new oz.framework.api.publisher("127.0.0.1", 9521); oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.url = "http://127.0.0.1/oz/server.aspx"; serverinfo.id = "admin"; serverinfo.password = "admin"; serverinfo.usertype = oz.scheduler.usertype.administrator; publisher.createfolder(serverinfo, "/folder"); oz.scheduler.fileinfo[] pubfileinfos = publisher.getpublishedfileinfos(serverinfo, "/ozd"); foreach(oz.scheduler.fileinfo pubfileinfo in pubfileinfos) Console.WriteLine("IsDirectory : " + pubfileinfo.isdirectory); Console.WriteLine("LastModified : " + pubfileinfo.lastmodified); Console.WriteLine("Name : " + pubfileinfo.name); Console.WriteLine("Size : " + pubfileinfo.size); System.IO.Stream inputstream = publisher.downloadfile(serverinfo, "/ozd/" + pubfileinfo.name); Console.WriteLine(inputStream.Length); try publisher.removefiles(serverinfo, "/folder", "file1", "file2"); catch(exception) 80 FORCS Co., LTD
// there is no files so error is gonna be occurred. publisher.removefolder(serverinfo, "/folder", true); FORCS Co., LTD 81
OZ API Developer's Guide (for.net) Constructor Summary Scheduler(string ip, int port) Method Summary string CreateTask(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) Vector GetTaskInfos(ServerInfo s) TaskResult[] GetTaskResults(ServerInfo s, string from, string to, string taskid) void GetTaskInfo(ServerInfo s, string taskid, out NameValueCollection configmap, out NameValueCollection exportmap) void RemoveTask(ServerInfo s, string taskid) string ModifyTask(ServerInfo s, string taskid, NameValueCollection configmap, NameValueCollection exportmap) bool PauseTask(ServerInfo s, string taskid) bool ResumeTask(ServerInfo s, string taskid) void Stop(ServerInfo s, bool forciblystop) bool Export(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) bool MakePDF(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) bool Print(ServerInfo s, NameValueCollection configmap, NameValueCollection printmap) NameValueCollection GetConfiguration(ServerInfo s) void ModifyConfiguration(ServerInfo s, NameValueCollection configmap) bool Ping() string[] GetSchedulingInfos (string path) void ConvertSchedulingInfos(string oldpath, string newpath) bool AddTaskHoliday(TaskHolidayInfo value) 82 FORCS Co., LTD
bool ModifyTaskHoliday(string old_key, TaskHolidayInfo new_value) bool DeleteTaskHoliday(string[] keys) bool AddTaskHolidayGroup(TaskHolidayGroupInfo value) bool ModifyTaskHolidayGroup(string old_key, TaskHolidayInfo new_value) bool DeleteTaskHolidayGroup(string key) TaskHolidayInfos GetTaskHolidayInfos() TaskHolidayGroupInfos GetTaskHolidayGroupInfos() void SaveTaskHoliday() DirectExportResult DirectExport(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) DirectPrintResult DirectPrint(ServerInfo s, NameValueCollection configmap, NameValueCollection printproperties) Constructor Detail public Scheduler(string ip, int port) ip port IP ex) string ip = "127.0.0.1"; ( : 9521) ex) int port = 9521; Method Detail CreateTask public string CreateTask(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) ID. : CreateTask Thread param. s configmap key "Option". FORCS Co., LTD 83
OZ API Developer's Guide (for.net) exportmap key "Option". GetTaskInfos public Vector GetTaskInfos(ServerInfo s). s GetTaskResults public TaskResult[] GetTaskResults(ServerInfo s, string from, string to, string taskid). s from to taskid GetTaskInfo public void GetTaskInfo(ServerInfo s, string taskid, out NameValueCollection configmap, out NameValueCollection exportmap) (configmap) (exportmap). s taskid configmap exportmap key "Option". key "Option". RemoveTask public void RemoveTask(ServerInfo s, string taskid). s 84 FORCS Co., LTD
taskid ModifyTask public string ModifyTask(ServerInfo s, string taskid, NameValueCollection configmap, NameValueCollection exportmap). s taskid configmap exportmap key "Option". key "Option". PauseTask public bool PauseTask(ServerInfo s, string taskid). s taskid ResumeTask public bool ResumeTask(ServerInfo s, string taskid). s taskid Stop public void Stop(ServerInfo s, bool forciblystop). s forciblystop Export FORCS Co., LTD 85
OZ API Developer's Guide (for.net) public bool Export(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap). : "ViewType=None". :.pdf,.ozd,.html,.jpg,.xls,.doc,.svg,.txt,.ppt,.tif, csv. s configmap exportmap key "Option". key "Option". MakePDF public bool MakePDF(ServerInfo s, NameValueCollection configmap, NameValueCollection exportmap) PDF. : "ViewType=None". s configmap exportmap key "Option". CreatTask() PDF. PDF key "Option". CreatTask() PDF. Print public bool Print(ServerInfo s, NameValueCollection configmap, NameValueCollection printmap) 86 FORCS Co., LTD
. ( ) : "task_type=viewertag". "ViewType=None". s configmap printmap key "Option". key "Option"., print.mode = silent. print API, print API. print API. viewer.allowmultiframe=true viewer.mode=print 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 NameValueCollection GetConfiguration(ServerInfo s). s ModifyConfiguration public void ModifyConfiguration(ServerInfo s, NameValueCollection configmap). FORCS Co., LTD 87
OZ API Developer's Guide (for.net) s configmap key "Option". Ping public bool Ping(). GetSchedulingInfos public string[]getschedulinginfos(string path) OZS. (path OZS, path OZS..) path OZS : OZS /%SCH_HOME%/[path]/. path sample /%SCH_HOME%/sample/ OZS. ConvertSchedulingInfos public void ConvertSchedulingInfos(string oldpath, string newpath) 2.5 OZS. oldpath newpath OZS : /%SCH_HOME%/[oldPath]/. OZS : /%SCH_HOME%/[newPath]/ newpath oldpath. AddTaskHoliday public bool AddTaskHoliday(TaskHolidayInfo value). value 88 FORCS Co., LTD
ModifyTaskHoliday public bool ModifyTaskHoliday(string old_key, TaskHolidayInfo new_value). old_key new_value DeleteTaskHoliday public bool DeleteTaskHoliday(string[] keys). keys AddTaskHolidayGroup public bool AddTaskHolidayGroup(TaskHolidayGroupInfo value). value ModifyTaskHolidayGroup public bool ModifyTaskHolidayGroup(string old_key, TaskHolidayGroupInfo new_value). old_key new_value DeleteTaskHolidayGroup public bool DeleteTaskHolidayGroup(string key). key GetTaskHolidayInfos public TaskHolidayInfos GetTaskHolidayInfos(). GetTaskHolidayGroupInfos FORCS Co., LTD 89
OZ API Developer's Guide (for.net) public TaskHolidayGroupInfos GetTaskHolidayGroupInfos(). SaveTaskHoliday public void SaveTaskHoliday() xml. DirectExport public DirectExportResult DirectExport(ServerInfo s, NameValueCollection configmap, NameValuecollection exportmap). : "ViewType=None". :.pdf,.ozd,.html,.jpg,.xls,.doc,.svg,.txt,.ppt,.tif, csv. s configmap exportmap key "Option". key "Option". DirectPrint public DirectPrintResult DirectPrint(ServerInfo s, NameValueCollection configmap, NameValuecollection printmap). : "task_type=viewertag". "ViewType=None". s configmap key "Option". 90 FORCS Co., LTD
printmap key "Option"., print.mode = silent. Class TaskResult(oz.scheduler.TaskResult). - TaskID public string TaskIDget;set; ID CompletedTime public string CompletedTimeget;set; IsSuccessful public bool IsSuccessfulget;set; FormFileName public string FormFileNameget;set; ParamInfo public string ParamInfoget;set; SchedulingType public string SchedulingTypeget;set; ExportedFiles FORCS Co., LTD 91
OZ API Developer's Guide (for.net) public string ExportedFilesget;set; ErrorMessage public string ErrorMessageget;set; DirectTaskResult(oz.scheduler.DirectTaskResult). - public string TaskID: ID public string CompletedTime : public string ExecuteTime: ( : ) public bool IsSuccessful: public string FormName: oz.scheduler.directexportresult extends DirectTaskResult. - public string ExportFileList: public int PageCount :., 4 xls, doc PageCount 8. "viewer.largebundle=true" PageCount 1. oz.scheduler.directprintresult extends DirectTaskResult. - public int PageCount: public int PageCopy: public string PageRange: public string PrinterName : 92 FORCS Co., LTD
public string PrinterDriverName : Option - "ViewType" "None", API, OZD. -,. viewer.mode viewer.useprogressbar viewer.allowmultiframe export.mode export.confirmsave information.debug viewer.showerrormessage export false true silent false debug false - Key Value report_name category_name - Key Value dm_server_check "check" "null" dm_server_name SDM (Repository odi category SDM ) odi_name ODI ODI odi_category_name ODI ( "/" ) FORCS Co., LTD 93
OZ API Developer's Guide (for.net) - Key Value task_type "viewertag" "sdm" viewertag : OZU g,. "SchedulerViewerTagSample.cs". sdm : SDM - Key Value external_program_che ck external_program_co mmand "check" "null" ("SCH_HOME/External" Key Value mail_check mail_notify_error_ch eck mail_recipient_to mail_recipient_cc mail_recipient_bcc "check" "null" "check" "null" mail_subject 94 FORCS Co., LTD
mail_text_message mail_html_comment html_mail_content mail_attach_list "check" "null" "check" "null" HTML HTML ( '/' ) Key Value file_export_list ( '/' ) Key Value parameter_count parameter_name_1... parameter_name_n (n : ) parameter_value_1... parameter_value_n (n : ) : ODI,. "[FORM].". empno "[FORM].empNo". ODI ODI. ODI "testodi" "id" "testodi.id" FORCS Co., LTD 95
OZ API Developer's Guide (for.net). ODI Key Value odi_parameter_count odi_parameter_name_1... odi_parameter_name_n (n : ) odi_parameter_value_1... odi_parameter_value_n (n : ) : ODI, ODI ODI. Key Value use_ozd_parameter true/false OZD OZD - Key Value launch_type "once" "immediately" "periodically" once : immediately : periodically : launch_type = once Key Value execution_year execution_month execution_day 96 FORCS Co., LTD
execution_hour execution_min launch_type = periodically Key Value start_year start_month start_day periodically_executi on_day_type "daily" "weekly" "monthly" periodically_execution_day_type = daily Key Value daily_type weekday daily_every_days () periodically_execution_day_type = weekly Key Value weekly_every_week s 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" FORCS Co., LTD 97
OZ API Developer's Guide (for.net) periodically_execution_day_type = monthly Key Value monthly_every_m onths ( ) monthly_type "specific_day", "day_of_week", "user_defined" monthly_days monthly_which_w eek "T1" "T2" "T3"" T4" "T5" T1 : T2 : T3 : T4 : T5 : monthly_which_w eek_day monthly_user_defi ned_days "sunday" "monday" "tuesday" "wednesday" "thursday" "friday" "saturday" (,) - Key Value periodically_exec ution_time_type "once" "repeat" "user_defined" (,, ) periodically_execution_time_type = once Key Value once_hour once_min periodically_execution_time_type = repeat Key Value 98 FORCS Co., LTD
repeat_every_hours repeat_every_minutes repeat_start_hour repeat_start_minute repeat_end_hour repeat_end_minute : 6 2 5 9 35 1 4. periodically_execution_time_type = user_defined Key Value user_defined_time (:) (,) ".mailattach". true, false. ex) setproperty("hdm.mailattach", "true") key " ". : Value "/." "%%\Repository/"., "FORCS" CSV setproperty("csv.filename", "FORCS/test.csv"), "%%\Repository/FORCS" "test.csv". modifyconfiguration ConfigMap Key Value SchedulerPort ( : "9521") FORCS Co., LTD 99
OZ API Developer's Guide (for.net) SchedulingInfoFil epath SMTPServer SMTP SMTPServerProt SMTP MailFrom TempRepositoryF ilepath RepositoryFileRo otpath ExternalProgram FilePath ErrorNotifyToSen der "true" "false" true : false : Sample : SchedulerSample.cs using System; using System.Collections.Specialized; using oz.scheduler.holiday; using oz.framework.api; namespace SchedulerSample public class Scheduler public static void Main() oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); if(scheduler.ping()) Console.WriteLine("Scheduler is alive. "); else Console.WriteLine("Scheduler is not being run. "); oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.url = " http://127.0.0.1/oz/server.aspx"; serverinfo.id = "admin"; serverinfo.password = "admin"; 100 FORCS Co., LTD
serverinfo.usertype = oz.scheduler.usertype.administrator; NameValueCollection properties = new NameValueCollection(); properties["report_name"] = "parameter_test.ozr"; // properties["category_name"] = "/"; // properties["cfg.type"] = "new"; // Task new, edit // properties["odi_name"] = "parameter_test.odi"; properties["odi_category_name"] = "/test"; properties["dm_server_check"] = "check"; properties["dm_server_name"] = "test1.sdm"; // // properties["odi_name"] = "parameter_test.odi"; // odi properties["odi_category_name"] = "/test"; // odi properties["external_program_check"] = "check"; properties["external_program_command"] = "notepad.bat"; //. // properties["parameter_count"] = "1"; // properties["parameter_name_1"] = "[FORM].empNo"; // properties["parameter_value_1"] = "10"; // // ODI properties["odi_parameter_count"] = "1"; // properties["odi_parameter_name_1"] = "id"; // properties["odi_parameter_value_1"] = "12"; // // properties["launch_type"] = "periodically"; properties["start_year"] = "2008"; properties["start_month"] = "5"; properties["start_day"] = "20"; //("immediately","periodically") properties["execution_year"] = "2003"; // - properties["execution_month"] = "12"; // - properties["execution_day"] = "17"; // - properties["execution_hour"] = "10";// - properties["execution_min"] = "30";// - properties["periodically_execution_day_type"] = "daily"; //("weekly", "monthly") properties["daily_type"] = "weekday"; //("specific_day") properties["periodically_execution_time_type"] = "once"; // ( "repeat", "user_defined") properties["once_hour"] = "01"; // - properties["once_min"] = "00"; // - // properties["mail_check"] = "check"; // - FORCS Co., LTD 101
OZ API Developer's Guide (for.net) properties["html_mail_content"] = "check"; // html properties["mail_notify_error_check"] = "null"; // - properties["mail_recipient_to"] = "gil_dong@forcs.com"; // properties["mail_recipient_cc"] = "abc@forcs.com"; // properties["mail_recipient_bcc"] = "lan@forcs.com"; // properties["mail_subject"] = " "; // properties["mail_text_message"] = " "; // properties["mail_attach_list"] = "csv/excel/html/ozd/pdf/text/tiff/word/ppt/jpg/svg"; // properties["file_export_list"] = "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg"; NameValueCollection exportproperties = new NameValueCollection(); exportproperties["csv.filename "] = "test.csv"; // csv exportproperties["csv.pagetitle "] = "page"; // exportproperties["csv.pageline "] = "7"; // exportproperties["csv.pagestyle"] = "none"; // exportproperties["csv.separator "] = "Tab"; // CSV exportproperties["csv.removerange "] = "1,3"; // CSV exportproperties["csv.exceptfirstpage "] = "true"; // exportproperties["csv.savetointeger "] = "true"; // // exportproperties["excel.filename "] = "test.xls"; // excel exportproperties["excel.numberformat "] = "#,##0.00"; // exportproperties["excel.savefont"] = "Arial"; // exportproperties["excel.matchmode"] = "columnpersheet"; // exportproperties["excel.matchsubmode"] = "rowfirst"; // exportproperties["excel.removerange"] = "1,3"; // exportproperties["excel.removeoption "] = " firstpageonly"; // exportproperties["excel.removeblank "] = " true"; // // hdm exportproperties["hdm.filename "] = "test.csv"; // hdm exportproperties["hdm.charset"] = "ANSI"; // exportproperties["hdm.extension"] = "csv"; // exportproperties["hdm.indent"] = "true"; // exportproperties["hdm.separator "] = "Tab"; // hdm 102 FORCS Co., LTD
// html exportproperties["html.filename "] = "test.html"; // html exportproperties["html.imagepath "] = "file://c:/image"; // html exportproperties["html.vertical "] = "1"; // html exportproperties["html.horizontal "] = "1"; // html exportproperties["html.savebypage "] = "true"; // html exportproperties["html.offsetx "] = "1"; // x offset exportproperties["html.offsety "] = "1"; // y offset // ozd exportproperties["ozd.filename "] = "test.ozd"; //OZD exportproperties["ozd.memoallowed "] = "true"; // exportproperties["ozd.password"] = "admin"; // ozd // pdf exportproperties["pdf.filename "] = "test.pdf"; //pdf exportproperties["pdf.saverange "] = "1.3"; //pdf exportproperties["pdf.title "] = "Report"; //pdf exportproperties["pdf.subject "] = "OZ"; //pdf exportproperties["pdf.creator "] = "hong"; //pdf exportproperties["pdf.author "] = "hong"; //pdf exportproperties["pdf.keyword "] = "oz"; //pdf exportproperties["pdf.userpassword"] = "user"; //pdf exportproperties["pdf.masterpassword "] = "admin"; //pdf exportproperties["pdf.printprotected "] = "true"; //pdf // text exportproperties["text.filename "] = "test.txt"; //text exportproperties["text.pagetitle "] = "page"; // exportproperties["text.pageline "] = "7"; // exportproperties["text.pagestyle"] = "none"; // exportproperties["text.separator "] = "Tab"; //text exportproperties["text.removerange "] = "1,3"; //text exportproperties["text.exceptfirstpage "] = "true"; // exportproperties["text.savetointeger "] = "true"; // // Tiff exportproperties["tiff.filename "] = "test.tif"; //tiff exportproperties["tiff.encode "] = "G3"; //tiff // word exportproperties["word.filename "] = "test.doc"; //word // ppt FORCS Co., LTD 103
OZ API Developer's Guide (for.net) exportproperties["ppt.filename "] = "test.ppt "; //ppt // jpg exportproperties["jpg.filename "] = "test.jpg "; //jpg // svg exportproperties["svg.filename "] = "test.svg"; //svg string taskid = scheduler.createtask(serverinfo, properties, exportproperties); scheduler.makepdf(serverinfo, properties, exportproperties); scheduler.makepdfbypooling(serverinfo, properties, exportproperties); NameValueCollection schedulerproperties = new NameValueCollection(); schedulerproperties["schedulerport"] = "9521";// schedulerproperties["schedulerserver"] = "%SCH_HOME%/ScheduledTask"; // schedulerproperties["smtpserver"] = "mail.forcs.com"; //SMTP schedulerproperties["smtpserverport"] = "25"; //SMTP schedulerproperties["mailfrom"] = "kil_dong@forcs.com"; // schedulerproperties["temprepositoryfilepath"] = "%SCH_HOME%/TempRepository"; // schedulerproperties["repositoryfilerootpath"] = "%SCH_HOME%/Repository"; //PDF schedulerproperties["externalprogramfilepath"] = "%SCH_HOME%/External"; // schedulerproperties["errornotifytosender"] = "false"; // scheduler.modifyconfiguration(serverinfo, schedulerproperties); schedulerproperties = scheduler.getconfiguration(serverinfo); foreach(oz.scheduler.scheduledtask taskinfo in scheduler.gettaskinfos(serverinfo)) Console.WriteLine("CategoryName : " + taskinfo.categoryname); Console.WriteLine("LastExecutionTime : " + taskinfo.lastexecutiontime); Console.WriteLine("NextExecutionTime : " + taskinfo.nextexecutiontime); Console.WriteLine("ReportName : " + taskinfo.reportname); Console.WriteLine("Status : " + taskinfo.status); Console.WriteLine("TaskID : " + taskinfo.taskid); Console.WriteLine("Type : " + taskinfo.type); 104 FORCS Co., LTD
foreach(oz.scheduler.taskresult result in scheduler.gettaskresults(serverinfo, string.empty, string.empty, string.empty)) Console.WriteLine("CompletedTime : " + result.completedtime); Console.WriteLine("ErrorMessage : " + result.errormessage); Console.WriteLine("ExportedFiles : " + result.exportedfiles); Console.WriteLine("FormFileName : " + result.formfilename); Console.WriteLine("IsSuccessful : " + result.issuccessful); Console.WriteLine("ParamInfo : " + result.paraminfo); Console.WriteLine("SchedulingType : " + result.schedulingtype); Console.WriteLine("TaskID : " + result.taskid); scheduler.pausetask(serverinfo, taskid); scheduler.resumetask(serverinfo, taskid); scheduler.removetask(serverinfo, taskid); scheduler.stop(serverinfo, true); Sample : SchedulerViewerTagSample.cs using System; using System.Collections.Specialized; using oz.scheduler.holiday; using oz.framework.api; namespace OZSchedulerAPITest /// <summary> /// SchedulerViewerTag. /// </summary> public class SchedulerViewerTag public static void Run() oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); if(scheduler.ping()) Console.WriteLine("Scheduler is alive. "); else Console.WriteLine("Scheduler is not being run. "); FORCS Co., LTD 105
OZ API Developer's Guide (for.net) oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.url = "http://127.0.0.1/oz/server.aspx"; serverinfo.id = "admin"; serverinfo.password = "admin"; serverinfo.usertype = oz.scheduler.usertype.administrator; NameValueCollection properties = new NameValueCollection(); //. properties["task_type"] = "viewertag"; // Task new, edit properties["cfg.type"] = "new"; // (:"immediately", :"periodically") properties["launch_type"] = "immediately"; NameValueCollection exportproperties = new NameValueCollection(); // //exportproperties["connection.server"] = "127.0.0.1"; //exportproperties["connection.port"] = "8003"; exportproperties["connection.servlet"] = "http://127.0.0.1/oz/server.aspx"; exportproperties["connection.reportname"] = "/parameter_test.ozr"; exportproperties["applet.mode"] = "export"; exportproperties["applet.useprogressbar"] = "false"; exportproperties["applet.allowmultiframe"] = "true"; exportproperties["connection.pcount"] = "2"; exportproperties["connection.args1"] = "formparam1="; exportproperties["connection.args2"] = "formparam2="; exportproperties["export.mode"] = "silent"; exportproperties["export.saveonefile"] = "true"; exportproperties["connection.fetchtype"] = "BATCH"; exportproperties["export.confirmsave"] = "false"; exportproperties["information.debug"] = "debug"; exportproperties["applet.showerrormessage"] = "false"; exportproperties["odi.parameter_test.pcount"] = "2"; exportproperties["odi.parameter_test.args1"] = "odiparam1="; exportproperties["odi.parameter_test.args2"] = "odiparam2="; exportproperties["odi.odinames"] = "parameter_test"; exportproperties["export.format"] = "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg/mht"; exportproperties["csv.filename"] = "1.csv"; exportproperties["excel.filename"] = "1.xls"; exportproperties["html.filename"] = "1.html"; exportproperties["ozd.filename"] = "1.ozd"; 106 FORCS Co., LTD
exportproperties["pdf.filename"] = "1.pdf"; exportproperties["text.filename"] = "1.txt"; exportproperties["tiff.filename"] = "1.tif"; exportproperties["word.filename"] = "1.doc"; exportproperties["ppt.filename"] = "1.ppt"; exportproperties["jpg.filename"] = "1.jpg"; exportproperties["svg.filename"] = "1.svg"; exportproperties["mht.filename"] = "1.mht"; exportproperties["hdm.filename"] = "1.hdm"; // exportproperties["viewer.childcount"] = "1"; exportproperties["child1.connection.server"] = "127.0.0.1"; exportproperties["child1.connection.port"] = "8003"; exportproperties["child1.connection.reportname"] = "/parameter_test.ozr"; exportproperties["child1.applet.mode"] = "export"; exportproperties["child1.applet.useprogressbar"] = "false"; exportproperties["child1.applet.allowmultiframe"] = "true"; exportproperties["child1.export.mode"] = "silent"; exportproperties["child1.connection.fetchtype"] = "BATCH"; exportproperties["child1.export.confirmsave"] = "false"; exportproperties["child1.information.debug"] = "debug"; exportproperties["child1.applet.showerrormessage"] = "false"; exportproperties["child1.connection.pcount"] = "2"; exportproperties["child1.connection.args1"] = "formparam1= 1"; exportproperties["child1.connection.args2"] = "formparam2= 2"; exportproperties["child1.odi.odinames"] = "parameter_test"; exportproperties["child1.odi.parameter_test.pcount"] = "2"; exportproperties["child1.odi.parameter_test.args1"] = "odiparam1= 3"; exportproperties["child1.odi.parameter_test.args2"] = "odiparam2= 4"; exportproperties["child1.export.format"] = "csv/xls/html/ozd/pdf/txt/tif/doc/ppt/jpg/svg/mht"; exportproperties["child1.csv.filename"] = "child_1.csv"; exportproperties["child1.excel.filename"] = "child_1.xls"; exportproperties["child1.html.filename"] = "child_1.html"; exportproperties["child1.ozd.filename"] = "child_1.ozd"; exportproperties["child1.pdf.filename"] = "child_1.pdf"; exportproperties["child1.text.filename"] = "child_1.txt"; exportproperties["child1.tiff.filename"] = "child_1.tif"; exportproperties["child1.word.filename"] = "child_1.doc"; exportproperties["child1.ppt.filename"] = "child_1.ppt"; exportproperties["child1.jpg.filename"] = "child_1.jpg"; exportproperties["child1.svg.filename"] = "child_1.svg"; exportproperties["child1.mht.filename"] = "child_1.mht"; exportproperties["child1.hdm.filename"] = "child_1.hdm"; // API. FORCS Co., LTD 107
OZ API Developer's Guide (for.net) string taskid = scheduler.createtask(serverinfo, properties, exportproperties); Sample : DirectExportResultSample.cs using System; using System.Collections.Specialized; using oz.framework.api; using oz.scheduler; namespace OZAPI_NET11 /// <summary> /// DirectExportResultSample. /// </summary> public class DirectExportResultSample public DirectExportResultSample() // // TODO:. // public static void Main() oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.id = "admin"; serverinfo.password = "admin"; serverinfo.usertype = oz.scheduler.usertype.administrator; NameValueCollection properties = new NameValueCollection(); properties["task_type"] = "viewertag"; properties["cfg.type"] = "new"; properties["launch_type"] = "immediately"; 108 FORCS Co., LTD
NameValueCollection exportproperties = new NameValueCollection(); // exportproperties["connection.server"] = "127.0.0.1"; exportproperties["connection.port"] = "8003"; exportproperties["connection.reportname"] = "/parameter_test.ozr"; exportproperties["viewer.mode"] = "export"; exportproperties["export.mode"] = "silent"; exportproperties["export.confirmsave"] = "false"; exportproperties["export.format"] = "xls"; exportproperties["xls.filename"] = "sample.xls"; DirectExportResult result = scheduler.directexport(serverinfo, properties, exportproperties); Console.WriteLine(" : " + result.taskid); Console.WriteLine(" : " + result.completedtime); Console.WriteLine(" ; " + result.executetime); Console.WriteLine(" : " + result.issuccessful); Console.WriteLine(" : " + result.formname); Console.WriteLine("Export " + result.exportfilelist); Console.WriteLine(" " + result.pagecount); Sample : DirectPrintResultSample.cs using System; using System.Collections.Specialized; using oz.framework.api; using oz.scheduler; namespace OZAPI_NET11 /// <summary> /// DirectPrintResultSample /// </summary> public class DirectPrintResultSample public DirectPrintResultSample() public static void Main() FORCS Co., LTD 109
OZ API Developer's Guide (for.net) oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); oz.scheduler.serverinfo serverinfo = new oz.scheduler.serverinfo(); serverinfo.isdaemon = false; serverinfo.ip = "127.0.0.1"; serverinfo.port = 8003; serverinfo.id = "admin"; serverinfo.password = "admin"; serverinfo.usertype = oz.scheduler.usertype.administrator; NameValueCollection properties = new NameValueCollection(); properties["task_type"] = "viewertag"; properties["cfg.type"] = "new"; properties["launch_type"] = "immediately"; NameValueCollection printproperties = new NameValueCollection(); // printproperties["connection.server"] = "127.0.0.1"; printproperties["connection.port"] = "8003"; printproperties["connection.reportname"] = "/parameter_test.ozr"; printproperties["applet.mode"] = "export"; printproperties["connection.pcount"] = "2"; printproperties["connection.args1"] = "formparam1="; printproperties["connection.args2"] = "formparam2="; printproperties["export.mode"] = "silent"; printproperties["export.saveonefile"] = "true"; printproperties["connection.fetchtype"] = "BATCH"; printproperties["export.confirmsave"] = "false"; printproperties["information.debug"] = "debug"; printproperties["applet.showerrormessage"] = "false"; printproperties["odi.parameter_test.pcount"] = "2"; printproperties["odi.parameter_test.args1"] = "odiparam1="; printproperties["odi.parameter_test.args2"] = "odiparam2="; printproperties["odi.odinames"] = "parameter_test"; printproperties["viewer.mode"] = "print"; printproperties["print.mode"] = "silent"; printproperties["viewer.printcommand"] = "true"; DirectPrintResult result = scheduler.directprint(serverinfo, properties, printproperties); Console.WriteLine(" : " + result.taskid); Console.WriteLine(" : " + result.completedtime); Console.WriteLine(" ; " + result.executetime); Console.WriteLine(" : " + result.issuccessful); 110 FORCS Co., LTD
Console.WriteLine(" : " + result.formname); Console.WriteLine(" : " + result.pagecount); Console.WriteLine(" : " + result.pagecopy); Console.WriteLine(" : " + result.pagerange); Console.WriteLine(" : " + result.printername); Console.WriteLine(" : " + result.printerdrivername); FORCS Co., LTD 111
OZ API Developer's Guide (for.net) Constructor Summary TaskHolidayInfo(string name) Property Summary string Nameget;set; string BaseDayget;set; HolidayType Typeget;set; int Startget;set; int Endget;set; Constructor Detail public TaskHolidayInfo(string name) name : ";". Property Detail Name public string Nameget;set; BaseDay public string BaseDayget;set; 112 FORCS Co., LTD
pattern : yyyy-mm-dd : yyyy-mm-01 : 1 yyyy-01-01 : 1 1 2007-01-01 : 2007 1 1 Type public string Typeget;set; (, ) solar : lunar : Start public int Startget;set; "baseday" End public int Endget;set; "baseday" Sample : SchedulerTaskHoliday.cs using System; namespace OZSchedulerAPITest public class TaskHoliday public static void Run() oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); oz.scheduler.holiday.taskholidayinfos holidayinfos = scheduler.gettaskholidayinfos(); foreach(oz.scheduler.holiday.taskholidayinfo holidayinfo in holidayinfos.values) Console.WriteLine("Name : " + holidayinfo.name); Console.WriteLine("Type : " + holidayinfo.type); FORCS Co., LTD 113
OZ API Developer's Guide (for.net) Console.WriteLine("BaseDay : " + holidayinfo.baseday); Console.WriteLine("Start : " + holidayinfo.start); Console.WriteLine("End : " + holidayinfo.end); Console.WriteLine(); oz.scheduler.holiday.taskholidayinfo anniversary = new oz.scheduler.holiday.taskholidayinfo(""); anniversary.baseday = "yyyy-07-25"; anniversary.type = oz.scheduler.holiday.holidaytype.solar; anniversary.start = 0; anniversary.end = 0; scheduler.addtaskholiday(anniversary); scheduler.savetaskholiday(); 114 FORCS Co., LTD
Constructor Summary TaskHolidayGroupInfo(string name) Proporty Summary string Nameget; string[] Referenceget; Method Summary void AddReference(params string[] names) void RemoveReferences(string[] names) void ClearReferences() Constructor Detail public TaskHolidayGroupInfo(string name) name : ";". Proporty Detail Name public string Nameget; References public string[] Referencesget; FORCS Co., LTD 115
OZ API Developer's Guide (for.net) Reference Method Detail AddReference public void AddReference(string[] names).. names ( ) RemoveReferences public void RemoveReferences(string[] names). names ClearReferences public void ClearReferences(). Sample : SchedulerTaskHoliday.cs using System; namespace OZSchedulerAPITest /// <summary> /// TaskHolidayGroup. /// </summary> public class TaskHolidayGroup public static void Run() oz.framework.api.scheduler scheduler = new oz.framework.api.scheduler("127.0.0.1", 9521); oz.scheduler.holiday.taskholidaygroupinfos holidaygroupinfos = scheduler.gettaskholidaygroupinfos(); 116 FORCS Co., LTD
foreach(oz.scheduler.holiday.taskholidaygroupinfo holidaygroupinfo in holidaygroupinfos.values) Console.WriteLine("Name : " + holidaygroupinfo.name); foreach(string reference in holidaygroupinfo.references) Console.Write(reference + "\t"); Console.WriteLine(); oz.scheduler.holiday.taskholidaygroupinfo groupinfo = new oz.scheduler.holiday.taskholidaygroupinfo("group3"); groupinfo.addreference("", "", "31 "); scheduler.addtaskholidaygroup(groupinfo); groupinfo.addreference(""); scheduler.modifytaskholidaygroup(groupinfo.name, groupinfo); scheduler.deletetaskholidaygroup(groupinfo.name); scheduler.savetaskholiday(); FORCS Co., LTD 117
OZ API Developer's Guide (for.net) 118 FORCS Co., LTD
RDB Store for.net DataAction Store DataAction DataAction Store DataAction FORCS Co., LTD 119
OZ API Developer's Guide (for.net) RDB DataAction. public interface IRDBDelegate : IDelegate System.Data.IDbConnection Connection set; void Init(string @param); void Close(); string Insert(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters); string Update(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters); string Delete(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters); string Commit(); void Rollback(); : DataAction. 1. Connection() 2. Init() 3. Insert(), Update(), Delete() 4. Commit(), Rollback() 5. Close() - RDBDelegateAttribute [AttributeUsage(AttributeTargets.Class, AllowMultiple=false)] public sealed class RDBDelegateAttribute : Attribute 120 FORCS Co., LTD
DataAction DataAction. using System; using System.Data; using System.Collections; namespace com.forcs.sample.dataaction.rdb /// <summary> ///. /// ILoggerRef /// IRDBDelegate.Connection set; /// IRDBDelegate.Init() /// IRDBDelegate.Insert() or Delete() or Update() /// IRDBDelegate.Commit() or Rollback() /// IRDBDelegate.Close() /// </summary> public class DelegateSample : oz.udd.irdbdelegate, oz.udd.iloggerref private oz.framework.log.ozlog log; private IDbConnection _con; public DelegateSample() #region IRDBDelegate public System.Data.IDbConnection Connection set //DB. _con = value; #endregion #region IDelegate public void Rollback() //Rollback. FORCS Co., LTD 121
OZ API Developer's Guide (for.net) public string Commit() //Commit. public void Init(string param) // TODO: DelegateSample.Init. log.debug("initialization called. Parameter is '" + param + "'"); public void Close() //Close. public string Insert(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters) //Insert. public string Delete(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters) //Delete. public string Update(oz.framework.dac.OZDACItem dac, System.Collections.IDictionary parameters) //Update. #endregion #region ILoggerRef public oz.framework.log.ozlog Log set //log. log = value; #endregion 122 FORCS Co., LTD
User Data Store for.net UDS for.net UDS for.net UDS for.net FORCS Co., LTD 123
OZ API Developer's Guide (for.net) UDS(User Data Store) ADO.NET Interface,, CSV, XML ASP. 1 ----------------- DataReader OZ User Data Source Interface ADO.NET DBMS Provider (ASP, ) UDS DataReader.. UDS SQL.. 124 FORCS Co., LTD
ADO.NET UDS. OZ Server Query String ADO.NET OZ Designer DataReader DBMS Provider DBMS ADO.NET DBMS Provider DBMS ADO.NET DBMS Provider DBMS DataReader.NET. DataReader ADO.NET System.Data.IDataReader Interface (implement)., DBMS DBMS ADO.NET DBMS Provider System.Data.IDataReader Interface Concrete DataReader. ADO.NET DBMS Provider System.Data.IDataReader Interface. OZ Server OZ Designer () Custom DataReader Custom ADO.NET DBMS Provider UDS(User Data Store) ADO.NET DBMS Provider Custom ADO.NET DBMS Provider System.Data.IDataReader interface DataReader. FORCS Co., LTD 125
OZ API Developer's Guide (for.net) UDS. OZUserDataReaderStore ADO.NET DBMS Provider. oz.uds.ozuserdatareaderstore Interface OZUserDataReaderStore Interface IDataReader Interface. oz.uds.ozuserdatareaderstore interface 4. using System; using System.Data; namespace oz.uds public abstract class OZUserDataReaderStore : IOZUserDataStore abstract public void Init(); abstract public IDataReader GetDataReader(string command); abstract public void FreeDataReader(IDataReader idr); abstract public void Close();. void Init() IDataReader GetDataReader(string command) UDS,. (). 126 FORCS Co., LTD
void FreeDataReader(IDataReader idr) void Close(). UDS,. : Init(), Close(). IDataReaderStore IDataReaderStore. public interface IDataReaderStore void Init(); void Close(); System.Data.IDataReader GetDataReader(System.String command); void Release(System.Data.IDataReader reader);. void Init() System.Data.IDataReader GetDataReader(System.String command) void Release(System.Data.IDataRead er reader) void Close() UDS,. ().. UDS,. IDataTableStore IDataTableStore. FORCS Co., LTD 127
OZ API Developer's Guide (for.net) public interface IDataTableStore void Init(); void Close(); System.Data.DataTable GetDataTable(System.String command); void Release(System.Data.DataTable table); void Init() System.Data.DataTable GetDataTable(System.String command) void Release (System.Data.DataTable table) void Close() UDS,. ().. UDS,. ILoggerRef ILoggerRef. public interface ILoggerRef oz.framework.log.ozlog Logger set;. oz.framework.log.ozlog Logger set;. 128 FORCS Co., LTD
UDS. : UDS. : postfix Visual Studio. UDS oz.uds.datastoreattribute Target UDS. Class datasourcetype Sample [oz.uds.datastore(typeof(idatareader))] public class UDS oz.uds.initattribute Target Sample UDS Method [oz.uds.init] public void Initialize() oz.uds.closeattribute Target Sample UDS. Method [oz.uds.close] public void Destruct() FORCS Co., LTD 129
OZ API Developer's Guide (for.net) oz.uds.getdataattribute Target Sample. Method [oz.uds.getdata] public IDataReader RetrieveData(string command) oz.uds.releasedataattribute Target Sample DataStoreAttribute datasourcetype. Method [oz.uds.releasedata] public void FinalizeData(IDataReader reader) oz.uds.insertattribute Target Sample. Method [oz.uds.insert] public string InsertData(string command, OZDACData[] data, string extraargs, Hashtable parameters) oz.uds.deleteattribute Target Sample. Method [oz.uds.delete] public string DeleteData(string command, OZDACData[] data, string extraargs, Hashtable parameters) oz.uds.updateattribute Target. Method 130 FORCS Co., LTD
Sample [oz.uds.update] public string UpdateAttribute(string command, OZDACData[] data1, OZDACData[] data2, string extraargs, Hashtable parameters) oz.uds.commitattribute Target Sample queue queue. Method [oz.uds.commit] public string CommitChanges() oz.uds.rollbackattribute Target Sample. Method public string DropChanges() oz.uds.sethttpcontextattribute Target HttpContext. Method, Property Sample [oz.uds.sethttpcontext] public void SetContext(HttpContext context) [oz.uds.sethttpcontext] public HttpContextContextset_ctx = value; oz.uds.setloggerattribute Target. Method, Property Sample [oz.uds.setlogger] public void SetLogger(oz.framework.log.OZLog log) [oz.uds.setlogger] public OZLog Loggersetlog = value; FORCS Co., LTD 131
OZ API Developer's Guide (for.net) oz.uds.setparameterattribute Target. Method, Property Sample [oz.uds.setparameter] public void SetParameter(Hashtable parameters) [oz.uds.setparameter] public Hashtableset_parameters = value; oz.uds.getaliasesattribute Target Sample DB DB. Method, Property [oz.uds.getaliases] public string[] GetAliases() [oz.uds.getaliases] public string[] Aliasesgetreturn new string[]"alias",... oz.uds.setconnections Target Sample GetAliasesAttribute DB DB. Method, Property [oz.uds.setconnections] public void SetConnections(IDictionary connections) [oz.uds.setconnections] public IDictionary Connectionsset_connections = value; 132 FORCS Co., LTD
UDS GetDataReader. UDS Source UDS Main Command. using System; using System.Web; using System.Data; using System.Data.SqlClient; using System.Collections; using oz.uds; namespace oz.uds public class UserDataReaderStore : OZUserDataReaderStore public UserDataReaderStore() public override IDataReader GetDataReader(string command) // Command IDataReader. // Command OZ. public override void Close() // UserDataSet. // DB Disconnection. public override void FreeDataReader(IDataReader reader) FORCS Co., LTD 133
OZ API Developer's Guide (for.net) // GetDataReader IDataReader. // IDataReader Close. public override void Init() // UDS. DB. DataReader DataReader DataReader. String ArrayList DataReader. oz oz.uds.dr API DataReader. oz DataReader. DataReader - string IDataReader API public ArrayDataReader(string[] fieldnames, string[][] data) public ArrayDataReader(string[] fieldnames, Type[] types, string[][] data) - ArrayList IDataReader API public ArrayListDataReader(ArrayList fieldnames, ArrayList[] data) public ArrayListDataReader(ArrayList fieldnames, ArrayList types, ArrayList[] data) - Dynamic DataReader API public DynamicDataReader(IDataReader reader) * Dynamic Field ArrayDataReader, ArrayListDataReader UDS #1 DB DataReader UDS. < UserDataReaderStore.cs> using System; using System.Web; using System.Data; using System.Data.SqlClient; using System.Collections; 134 FORCS Co., LTD
using oz.uds; namespace oz.uds public class UserDataReaderStore : OZUserDataReaderStore, IConnectionRef IDbConnection con; public UserDataReaderStore() public override IDataReader GetDataReader(string command) IDbCommand cmd = con.createcommand(); cmd.commandtext = command; return cmd.executereader(); public override void Close() con.close(); public override void FreeDataReader(IDataReader reader) reader.close(); public override void Init() // oz server alias name private const string s_alias = "test"; public IDictionary Connections set con = (IDbConnection)value[s_alias]; public string[] Aliases get return new string[]s_alias ; FORCS Co., LTD 135
OZ API Developer's Guide (for.net) UDS #2 DB DataTable UDS. < UserDataTableStore.cs> using System; using System.Web; using System.Data; using System.Collections; using System.Data.SqlClient; using oz.uds; namespace oz.uds public class UserDataTableStore : OZUserDataTableStore, IConnectionRef IDbConnection con; public UserDataTableStore() public override DataTable GetDataTable(string command) DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(); IDbCommand cmd = con.createcommand(); cmd.commandtext = command; da.selectcommand = (SqlCommand)cmd; da.fill(dt); return dt; public override void Close() con.close(); public override void FreeDataTable(DataTable dt) dt.dispose(); public override void Init() 136 FORCS Co., LTD
private const string s_alias = "test"; public IDictionary Connections set con = (IDbConnection)value[s_alias]; public string[] Aliases get return new string[]s_alias ; UDS #3 string Data UDS. < UserStringStore.cs> using System; using System.Web; using System.Data; using System.Collections; using oz.uds; using oz.uds.dr; namespace oz.uds public class UserStringStore : OZUserDataReaderStore string[] fieldname = "field1", "field2"; string[][] data = new string[][]new string[]"data11","data12", new string[]"data21", "data22"; public UserStringStore() public override IDataReader GetDataReader(string command) return new ArrayDataReader(fieldname,data); public override void Close() public override void FreeDataReader(IDataReader reader) FORCS Co., LTD 137
OZ API Developer's Guide (for.net) public override void Init() UDS #4. < DataGenerator.cs > using System; using System.IO; using System.Data; using oz.uds; using oz.util; namespace oz.uds /// <summary> /// DataGenerator /// </summary> public class DataGenerator : OZUserDataReaderStore public DataGenerator() public override void Init() public override void Close() public override IDataReader GetDataReader(string command) DirectoryInfo directory = new DirectoryInfo(command); FileSystemInfo[] infos = directory.getfilesysteminfos(); /// Rectangular Array string[] fieldnames = "Name", "Attributes", "Creation Time", "Last Modified Time"; string[,] data = new string[infos.length, fieldnames.length]; int index = 0; foreach(filesysteminfo info in infos) 138 FORCS Co., LTD
data[index,0] = info.name; data[index,1] = info.attributes.tostring(); data[index,2] = info.creationtime.tostring(); data[index,3] = info.lastwritetime.tostring(); index++; return new oz.uds.dr.arraydatareader(fieldnames, data); public override void FreeDataReader(IDataReader idr) UDS #5 DB IDataReaderStore UDS. using System; using System.Web; using System.Data; using System.Collections; using oz.uds; using oz.uds.dr; namespace oz.uds.sample.csharp.@interface public class ArrayDataReaderSample : IDataReaderStore, IHttpContextRef, IParameterRef private HttpContext _ctx; private IDictionary _params; public HttpContext HttpContext set _ctx = value; public IDictionary Parameters set _params = value; public void Init() public IDataReader GetDataReader(string command) int fieldcount = oz.util.ozstring.parseint(convert.tostring(_params["field_count"]), 5); int rowcount = oz.util.ozstring.parseint(convert.tostring(_params["row_count"]), 5); bool usejaggedarray = oz.util.ozstring.parsebool(convert.tostring(_params["use_jagged_array"]), false); string[] fieldnames = new string[fieldcount]; string[][] jagged = null; string[,] rectangular = null; FORCS Co., LTD 139
OZ API Developer's Guide (for.net) if(usejaggedarray) jagged = new string[rowcount][]; else rectangular = new string[rowcount, fieldcount]; for(int col = 0; col < fieldcount; col++) fieldnames[col] = "Field" + col; for(int row = 0; row < rowcount; row++) if(usejaggedarray) jagged[row] = new string[fieldcount]; for(int col = 0; col < fieldcount; col++) string value = "Value - " + row + "," + col; if(usejaggedarray) jagged[row][col] = value; else rectangular[row,col] = value; if(usejaggedarray) return new ArrayDataReader(fieldNames, jagged); else return new ArrayDataReader(fieldNames, rectangular); public void Release(IDataReader reader) public void Close() UDS #6 IDataTableStore UDS. using System; using System.Web; using System.Data; using System.Collections; using oz.uds; using oz.uds.dr; using oz.framework.dac; 140 FORCS Co., LTD
namespace oz.uds.sample.csharp.@interface public class UserDataTableStoreSample : IDataTableStore, IParameterRef, ILoggerRef, IDataAction private HttpContext _ctx; private IDictionary _params; private oz.framework.log.ozlog log; public HttpContext HttpContext set _ctx = value; public IDictionary Parameters set _params = value; public oz.framework.log.ozlog Logger set log = value; public void Init() public DataTable GetDataTable(string command) int fieldcount = oz.util.ozstring.parseint(convert.tostring(_params["field_count"]), 5); int rowcount = oz.util.ozstring.parseint(convert.tostring(_params["row_count"]), 5); DataTable table = new DataTable(); for(int i = 0; i < fieldcount; i++) table.columns.add("field" + i); for(int rowindex = 0; rowindex < rowcount; rowindex++) DataRow row = table.newrow(); for(int colindex = 0; colindex < fieldcount; colindex++) row[colindex] = "value " + rowindex + ", " + colindex; table.rows.add(row); return table; public void Release(DataTable table) if(null!= table) table.dispose(); FORCS Co., LTD 141
OZ API Developer's Guide (for.net) public void Close() public void Rollback() log.debug("rolling back. "); public string Commit() log.debug("committing. "); return "commit"; public string UpdateRow(string command, oz.framework.dac.ozdacdata[] condition, oz.framework.dac.ozdacdata[] source, string extra, Hashtable parameters) log.debug("update command : " + command); foreach(ozdacdata data in condition) log.debug(data.fieldname + "=" + data.fielddata); foreach(ozdacdata data in source) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); return "update"; public string InsertRow(string command, oz.framework.dac.ozdacdata[] source, string extra, Hashtable parameters) log.debug("update command : " + command); foreach(ozdacdata data in source) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); 142 FORCS Co., LTD
return "insert"; public string DeleteRow(string command, oz.framework.dac.ozdacdata[] condition, string extra, Hashtable parameters) log.debug("update command : " + command); foreach(ozdacdata data in condition) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); return "delete"; UDS #7 DB UDS. using System; using System.Web; using System.Data; using System.Collections; using oz.uds; using oz.uds.dr; namespace oz.uds.sample.csharp.attribute [DataStore(typeof(ArrayDataReader))] public class ArrayDataReaderSample private oz.framework.log.ozlog log; private HttpContext _ctx; private IDictionary _params; [SetHttpContext] public HttpContext HttpContext set _ctx = value; [SetParameter] public IDictionary Parameters set _params = value; FORCS Co., LTD 143
OZ API Developer's Guide (for.net) [SetLogger] public oz.framework.log.ozlog Logger set log = value; [Init] public void Init() [GetData] public IDataReader GetDataReader(string command) log.debug("creating result set. " + command); int fieldcount = oz.util.ozstring.parseint(convert.tostring(_params["field_count"]), 5); int rowcount = oz.util.ozstring.parseint(convert.tostring(_params["row_count"]), 5); bool usejaggedarray = oz.util.ozstring.parsebool(convert.tostring(_params["use_jagged_array"]), false); string[] fieldnames = new string[fieldcount]; string[][] jagged = null; string[,] rectangular = null; if(usejaggedarray) jagged = new string[rowcount][]; else rectangular = new string[rowcount, fieldcount]; for(int col = 0; col < fieldcount; col++) fieldnames[col] = "Field" + col; for(int row = 0; row < rowcount; row++) if(usejaggedarray) jagged[row] = new string[fieldcount]; for(int col = 0; col < fieldcount; col++) string value = "Value - " + row + "," + col; if(usejaggedarray) jagged[row][col] = value; else rectangular[row,col] = value; if(usejaggedarray) return new ArrayDataReader(fieldNames, jagged); 144 FORCS Co., LTD
else return new ArrayDataReader(fieldNames, rectangular); [ReleaseData] public void FreeDataReader(IDataReader reader) [Close] public void Close() UDS #8 UDS. using System; using System.Web; using System.Data; using System.Collections; using oz.uds; using oz.uds.dr; using oz.framework.dac; namespace oz.uds.sample.csharp.attribute [DataStore(typeof(DataTable))] public class UserDataTableStoreSample private oz.framework.log.ozlog log; private HttpContext _ctx; private IDictionary _params; [SetHttpContext] public HttpContext HttpContext set _ctx = value; [SetParameter] public IDictionary Parameters set _params = value; [SetLogger] public oz.framework.log.ozlog Logger set log = value; FORCS Co., LTD 145
OZ API Developer's Guide (for.net) [Init] public void Init() [GetData] public DataTable GetDataTable(string command) int fieldcount = oz.util.ozstring.parseint(convert.tostring(_params["field_count"]), 5); int rowcount = oz.util.ozstring.parseint(convert.tostring(_params["row_count"]), 5); DataTable table = new DataTable(); for(int i = 0; i < fieldcount; i++) table.columns.add("field" + i); for(int rowindex = 0; rowindex < rowcount; rowindex++) DataRow row = table.newrow(); for(int colindex = 0; colindex < fieldcount; colindex++) row[colindex] = "value " + rowindex + ", " + colindex; table.rows.add(row); return table; [ReleaseData] public void Release(DataTable table) if(null!= table) table.dispose(); [Close] public void Close() [Rollback] public void DropChanges() log.debug("rolling back. "); 146 FORCS Co., LTD
[Commit] public string Mirror() log.debug("committing. "); return "commit"; [Update] public string ModifyData(string command, oz.framework.dac.ozdacdata[] condition, oz.framework.dac.ozdacdata[] source, string extra, Hashtable parameters) log.debug("update command : " + command); foreach(ozdacdata data in condition) log.debug(data.fieldname + "=" + data.fielddata); foreach(ozdacdata data in source) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); return "update"; [Insert] public string PutData(string command, oz.framework.dac.ozdacdata[] source, string extra, Hashtable parameters) log.debug("update command : " + command); foreach(ozdacdata data in source) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); return "insert"; [Delete] public string RemoveData(string command, oz.framework.dac.ozdacdata[] condition, string extra, Hashtable parameters) log.debug("update command : " + command); FORCS Co., LTD 147
OZ API Developer's Guide (for.net) foreach(ozdacdata data in condition) log.debug(data.fieldname + "=" + data.fielddata); foreach(dictionaryentry entry in parameters) log.debug(entry.key + "=" + entry.value); return "delete"; 148 FORCS Co., LTD
User Defined Log UDL UDL UDL FORCS Co., LTD 149
OZ API Developer's Guide (for.net) 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 150 FORCS Co., LTD
UDL. oz.udl.ozuserdefinedlogger OZ UDL oz.udl.ozuserdefinedlogger. oz.udl.ozuserdefinedlogger init, tracelog, getozdbalias. init public void init(oz.framework.db.ozconnection ozconn, com.forcs.log4oz.ozlog log). ozconn log DB DB Trace public void Trace(oz.udl.IUserDefinedLogTarget target, oz.framework.db.ozconnection ozconn, oz.framework.log.ozlog log). target ozconn IUserDefinedLogTarget. DB DB log getozdbalias FORCS Co., LTD 151
OZ API Developer's Guide (for.net) return public java.lang.string getozdbalias() throws OZUserDefinedLogException DB. DB : (ex. [OSUDLInitialize]). public class UserDefinedLogger : IUserDefinedLogger public void Init(OZConnection con, OZLog log) public void Trace(IUserDefinedLogTarget target, OZConnection con, OZLog log) public string DbAlias get;. public class UserDefinedLogger [OZUDLInitialize] public void Init(OZConnection con, OZLog log) [OZUDLTrace] public void Trace(IUserDefinedLogTarget target, OZConnection con, OZLog log) [OZUDLDbAlias] public string DbAlias get; IUserDefinedLogTarget oz.udl.iuserdefinedlogtarget oz.udl.idmlogtarget oz.udl.irdblogtarget oz.udl.iprocedurelogtarget oz.udl.iudslogtarget oz.udl.ifilestorelogtarget 152 FORCS Co., LTD
oz.udl.ihttpstorelogtarget oz.udl.ixmllogtarget oz.udl.isoaplogtarget oz.udl.isaplogtarget oz.udl.iclearquestlogtarget oz.udl.iuserdefinedlogtarget oz.udl.imonitorlogtarget IUserDefinedLogTarget OZ UDL. IPAddress return public String IPAddress()get; IP IP HttpRequest return public HttpServletRequest HttpRequest()get; HttpRequest. HttpRequest HttpContext return public HttpServlet HttpContext()get; HttpContext. HttpContext UserID return public String UserID()get; ID ID IDMLogTarget OZ UDL. ODIName FORCS Co., LTD 153
OZ API Developer's Guide (for.net) return public String ODIName()get; ODI. ODI DataSetName return public String DataSetName()get;. DataStoreName return public String DataStoreName()get;. Parameters return public System.Connection.IDictionary Parametersget; IRDBLogTarget OZ UDL RDB. DBAlias return public String DBAliasget; ODI DB. DB :. Query return public String Queryget;. PreparedQueryValue 154 FORCS Co., LTD
return public Vector PreparedQueryValueget;. ( ) QueryState return public String QueryStateget;. true flase QueryExecuteTime return public long QueryExecuteTimeget;. ( : mesc) isprepared public String ispreparedget;. return true flase QueryType public String QueryTypeget;. return select insert update delete Select Insert Update Delete IProcedureLogTarget OZ UDL. Alias public String Aliasget; ODI DB. FORCS Co., LTD 155
OZ API Developer's Guide (for.net) return DB :. ProcedureName return public String ProcedureNameget;. ParameterList return public IList ParameterListget; IList. ProcedureExecuteTime return public long ProcedureExecuteTimeget;. ( : mesc) ProcedureState return public String ProcedureStateget;. true false:errmsg "false: " IUDSLogTarget OZ UDL. ExecuteCommand return public String ExecuteCommandget;. QueryType 156 FORCS Co., LTD
publicquerytype QueryTypeget;. return select insert update delete Select Insert Update Delete CommandExecuteTime return public long CommandExecuteTimeget;. ( : mesc) CommandState return public String CommandStateget;. true false:errmsg "false: " IFileStoreLogTarget OZ UDL. FilePath return public String FilePathget;. FileAccessTime return public long FileAccessTimeget;. ( : mesc) FileAccessState public String FileAccessStateget;. FORCS Co., LTD 157
OZ API Developer's Guide (for.net) return true false:errmsg "false: " IHTTPStoreLogTarget OZ UDL HTTP HTTP. URL return public String URLget; URL. URL HTTPAccessTime return public long HTTPAccessTimeget; HTTP. ( : mesc) HTTPAccessState return public String HTTPAccessStateget; HTTP. true false:errmsg "false: " IXMLLogTarget OZ UDL XML XML. URL return public String URLget; URL. URL URLAccessTime public long URLAccessTimeget; URL. 158 FORCS Co., LTD
return ( : mesc) URLAccessState return public String URLAccessStateget; URL. true false:errmsg "false: " ISOAPLogTarget OZ UDL SOAP Service Response. ServiceName return public String ServiceNameget;. Port return public String Portget;. Operation return public String Operationget;. EndPoint return public String EndPointget; EndPoint. EndPoint RequestXML public String RequestXMLget; XML. FORCS Co., LTD 159
OZ API Developer's Guide (for.net) return XML ServiceExecuteTime return public long ServiceExecuteTimeget;. ( : mesc) ServiceState return public String ServiceStateget; SOAP. true false:errmsg "false: " ISAPLogTarget OZ UDL SAP. FunctionName return public String FunctionNameget;. FunctionType return public String FunctionTypeget;. InputParameters return public IDictionary InputParametersget; IDictionary. key value ResultSetTypes public String ResultSetTypesget; ResultSet. 160 FORCS Co., LTD
return Structure Table SimpleFields Structure Table SimpleFields FunctionExecuteTime return public long FunctionExecuteTimeget;. ( : mesc) FunctionState return public String FunctionStateget;. true false:errmsg "false: " IClearQuestLogTarget OZ UDL Clear Quest Clear Quest. ExecuteType public String ExecuteTypeget; Clear Quest. ExecuteSQL SQL return ExecuteQuery ExecuteDynamicQuery QuerySubType return public String QuerySubTypeget; QuerySub. Query Query Chart Chart Query public String Queryget;. FORCS Co., LTD 161
OZ API Developer's Guide (for.net) return QueryExecuteTime return public long QueryExecuteTimeget;. ( : mesc) QueryState return public String QueryStateget;. true false:errmsg "false: " IMonitorLogTarget OZ UDL. ODIName return public String ODIName()get; ODI. ODI Mark public string Mark()get;. return start end ThreadName return public string ThreadName()get;. ServiceTime public long getservicetime()get; 162 FORCS Co., LTD
return. ( : ms) : 1970 1 1 Millisecond. FreeMemory return public long FreeMemory()get;. ( : byte) TotalMemory return public long TotalMemory()get; JVM. ( : byte) ServiceCode return public integer ServiceCode()get;. MARK "end" "start" -1. ". ". ServiceStatus return public integer ServiceStatus()get;. MARK "end" "start" -1. "9001", "9002". 9001 9002 ServiceParameter public string ServiceParameter()get; FORCS Co., LTD 163
OZ API Developer's Guide (for.net) return. : MARK "end" "start" -1. DBSessionID return public string DBSessionID()get; DBMS ID. : MARK "end" "start" -1. DBMS ID ExecuteTime return public string ExecuteTime()get;. ( : ms) : MARK "end" "start" -1. ErrorCode return public String ErrorCode()get;. : conf/server_error_msg.xml.. ErrorMsg return public String ErrorMsg()get;. ErrorStackTrace return public String ErrorStackTrace()get; Stack Trace. Stack Trace 164 FORCS Co., LTD
UDL. - UDL : OZ_HOME/bin/ozudl.dll - Lof4j : OZ_HOME/bin/log4net.dll - UDL : OZ_HOME/conf/ozudl.properties - udlmngr.properties UDL. #--------------------------------- # configuration 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 OZ_UDL_MONITOR.Class=oz.udl.UDL ex) FORCS Co., LTD 165
OZ API Developer's Guide (for.net) OZ_USER_DEFINED_LOG.Class=oz.udl.file.OZUserDefinedLogger OZ_UDL_MONITOR.Class=oz.udl.db.OZMonitorLogForDB - OZ_HOME/Web.config.Net Framework. <?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <!--.Net Framework 2.0.Net Framework.--> <sectiongroup name="udl"> <section name="file" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="db" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectiongroup> </configsections> <system.web> <httpruntime maxrequestlength="100000" /> </system.web> <udl> <file> <add key="path" value="c:/program Files/Forcs/50/OZ Server.NET 5.0/logs/UDL.Log" /> <add key="layout" value="%dyyyy-mm-dd HH:mm:ss.fff [%-5p] %C1.%M - %m%n" /> <add key="daily" value="false" /> <add key="size" value="100kb" /> <add key="maxbackup" value="5" /> <!--add key="daily" value="true" /> <add key="pattern" value="yyyy-mm-dd" /--> </file> <db> <add key="alias" value="qa_ms" /> </db> </udl> </configuration> - <configsections>. -.Net Framework 2.0 sectiongroup.net Framework. - ODI ODBC ODBC MDB 166 FORCS Co., LTD
. MDB [ ]. [] ASP.NET ASP.NET UDL 1 - UDL. UDL. java oz.udl.file.ozuserdefinedloggerforfile "ozudl.dll". #region Using Statements using System; using System.Web; using System.Text; using System.Globalization; using System.Configuration; using System.Collections; FORCS Co., LTD 167
OZ API Developer's Guide (for.net) using System.Collections.Specialized; using oz.udl; using oz.dm.meta; using log4net; using log4net.appender; #endregion namespace oz.udl.file public class OZUserDefinedLogger : oz.udl.iuserdefinedlogger private string _name = "File UDL"; private ILog log; public OZUserDefinedLogger() log) public void Init(oz.framework.db.OZConnection con, oz.framework.log.ozlog log.debug(_name, "Called init"); NameValueCollection values = (NameValueCollection)ConfigurationSettings.GetConfig("udl/file"); if(null == values) throw new Exception("Cannot find udl file configuration"); // configure appender programmatically RollingFileAppender appender = new RollingFileAppender(); log4net.layout.patternlayout layout = new log4net.layout.patternlayout(); layout.conversionpattern = values["layout"]; layout.activateoptions(); appender.layout = layout; appender.file = values["path"]; appender.appendtofile = true; appender.maximumfilesize = values["size"]; appender.immediateflush = true; if(0 == string.compare(values["type"], "daily", true)) appender.rollingstyle = RollingFileAppender.RollingMode.Date; appender.datepattern = values["pattern"]; else 168 FORCS Co., LTD
appender.rollingstyle = RollingFileAppender.RollingMode.Size; appender.maxsizerollbackups = int.parse(values["maxbackup"]); appender.activateoptions(); this.log = LogManager.GetLogger(_name); log4net.repository.hierarchy.logger core = (log4net.repository.hierarchy.logger)this.log.logger; ((log4net.repository.ibasicrepositoryconfigurator)core.repository).configure(ap pender); public string DbAlias get return null; public void Trace(IUserDefinedLogTarget target, oz.framework.db.ozconnection con, oz.framework.log.ozlog log) if(log.isdebugenabled) log.debug(_name, "Called trace"); StringBuilder sb = new StringBuilder(4096); IRDBLogTarget rdbstore = target as IRDBLogTarget; if(null!= rdbstore) sb.appendformat("[db Alias=0][IP Address=1][User ID=2][QueryType=3][Query=4][IsPrepared=5]", rdbstore.alias, rdbstore.ipaddress, rdbstore.userid, rdbstore.querytype, rdbstore.query, rdbstore.isprepared); if(rdbstore.isprepared) sb.append("[preparedvalues="); foreach(object o in rdbstore.preparedqueryvalues) sb.append(null == o? "null" : o is byte[]? "binary" : o.tostring()); sb.append(";"); sb.append("]"); FORCS Co., LTD 169
OZ API Developer's Guide (for.net) sb.appendformat("[queryexetime=0][querystate=1]", rdbstore.queryexecutiontime, rdbstore.querystate); IProcedureLogTarget procestore = target as IProcedureLogTarget; if(procestore!= null) sb.appendformat("[dbalias=0][procedurename=1][procedureexecutetime=2][pro cedurestate=3]", procestore.alias,procestore.procedurename,procestore.procedureexecutetime,proce Store.ProcedureState); sb.append("[parameterlist="); IList list = procestore.parameterlist; foreach(ozprocedureparameter param in list) string paramname = param.name; string paramvalue = param.value; sb.append("name="); sb.append(paramname); sb.append(",value="); sb.append(paramvalue); sb.append(";"); sb.append("]"); IUDSLogTarget udsstore = target as IUDSLogTarget; if(udsstore!=null) sb.appendformat("[executecommand=0][querytype=1][commandexecutetime=2][co mmandstate=3]", udsstore.executecommand,udsstore.querytype,udsstore.commandexecutetime,udsstore.commandstate); IFileStoreLogTarget filestore = target as IFileStoreLogTarget; if(filestore!=null) sb.appendformat("[filepath=0][fileaccesstime=1][fileaccessstate=2]]", filestore.filepath,filestore.fileaccesstime,filestore.fileaccesstime); 170 FORCS Co., LTD
IHTTPStoreLogTarget httpstore = target as IHTTPStoreLogTarget; if(httpstore!=null) sb.appendformat("[url=0][httpaccesstime=1][httpaccessstate=2]]", httpstore.url,httpstore.httpaccesstime,httpstore.httpaccessstate); IXMLLogTarget xmlstore = target as IXMLLogTarget; if(xmlstore!=null) sb.appendformat("[url=0][urlaccesstime=1][urlaccessstate=2]]", xmlstore.url,xmlstore.urlaccesstime,xmlstore.urlaccessstate); ISOAPLogTarget soapstore = target as ISOAPLogTarget; if(soapstore!=null) sb.appendformat("[servicename=0][port=1][endpoint=2][serviceexecutetime= 3][ServiceState=4][RequestXML=5]]", soapstore.servicename,soapstore.port,soapstore.endpoint,soapstore.serviceexecut etime,soapstore.servicestate,soapstore.requestxml); ISAPLogTarget sapstore = target as ISAPLogTarget; if(sapstore!=null) sb.appendformat("[functionname=0][functiontype=1][resultsettypes=2][funct ionexecutetime=3][functionstate=4]", sapstore.functionname,sapstore.functionstate,sapstore.resultsettypes,sapstore.f unctionexecutetime,sapstore.functionstate); IDictionary id = sapstore.inputparameters; IDictionaryEnumerator param = id.getenumerator(); sb.append("[inputparameters="); while(param.movenext()) sb.append("key="); sb.append(param.key); sb.append(",value="); sb.append(param.value); sb.append(";"); sb.append("]"); FORCS Co., LTD 171
OZ API Developer's Guide (for.net) IClearQuestLogTarget clearstore = target as IClearQuestLogTarget; if(clearstore!=null) sb.appendformat("[executetype=0][querysubtype=1][query=2][queryexecutetim e=3][querystate=4]", clearstore.executetype,clearstore.querysubtype,clearstore.query,clearstore.quer yexecutetime,clearstore.querystate); IDMLogTarget datamodule = target as IDMLogTarget; if(null!= datamodule) sb.appendformat("[odiname=0][datasetname=1][datastorename=2]", datamodule.odiname, datamodule.datasetname, datamodule.datastorename); NameValueCollection parameters = null!= target.httprequest? target.httprequest.params : null; if(null!= parameters) sb.append("[requestparams="); foreach(string key in parameters.allkeys) sb.appendformat("(0,1)", key, parameters[key]); sb.append("]"); System.Web.SessionState.HttpSessionState session = null!= target.httpcontext? target.httpcontext.session : null; if(null!= session) sb.append("[sessionattrs="); foreach(string key in session.keys) sb.appendformat("(0,1)", key, session[key]); this.log.debug(sb.tostring()); 172 FORCS Co., LTD
public class OZUserDefinedLogger2 private OZUserDefinedLogger _logger; public OZUserDefinedLogger2() _logger = new OZUserDefinedLogger(); log) [OZUDLInitialize] public void Init(oz.framework.db.OZConnection con, oz.framework.log.ozlog _logger.init(con, log); [OZUDLTrace] public void Trace(IUserDefinedLogTarget target, oz.framework.db.ozconnection con, oz.framework.log.ozlog log) _logger.trace(target, con, log); UDL OZ_HOME/conf/ozudl.properties. #--------------------------------- # configuraion of OZ User Defined log #--------------------------------- OZ_USER_DEFINED_LOG.Active=true OZ_USER_DEFINED_LOG.Class=oz.udl.file.OZUserDefinedLoggerForFile Web.config. <?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <!--.Net Framework 2.0.Net Framework.--> <sectiongroup name="udl"> <section name="file" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> FORCS Co., LTD 173
OZ API Developer's Guide (for.net) <section name="db" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectiongroup> </configsections> <system.web> <httpruntime maxrequestlength="100000" /> </system.web> <udl> <file> <add key="path" value="c:/program Files/Forcs/50/OZ Server.NET 5.0/logs/UDL.Log" /> <add key="layout" value="%dyyyy-mm-dd HH:mm:ss.fff [%-5p] %C1.%M - %m%n" /> <add key="daily" value="false" /> <add key="size" value="100kb" /> <add key="maxbackup" value="5" /> <!--add key="daily" value="true" /> <add key="pattern" value="yyyy-mm-dd" /--> </file> <db> <add key="alias" value="qa_ms" /> </db> </udl> </configuration>.. 174 FORCS Co., LTD
[Data Action]. /log "UDL.log". UDL.log ODI. [DEBUG] OZUserDefinedLogger.Trace - [DB Alias=odbc^^ozcar][IP Address=127.0.0.1][User ID=admin][QueryType=Select][Query=select * from REQ397] [IsPrepared=False][QueryExeTime=156250][QueryState=True][ODIName=/DataAct ion.odi][datasetname=sample_][datastorename=db_] [RequestParams=(ASP.NET_SessionId,45qruu55wds3w1451vibhs55)(ALL_HTTP,HTTP... [DEBUG] OZUserDefinedLogger.Trace - [DB Alias=odbc^^ozcar][IP Address=127.0.0.1][User ID=admin][QueryType=Insert][Query=insert into REQ397 (id,name,address) values (?,?,?)] [IsPrepared=True][PreparedValues=3;3;3;][QueryExeTime=156250][QueryState= True][ODIName=/DataAction.odi][DataSetName=Sample][DataStoreName=DB_] [RequestParams=(ASP.NET_SessionId,45qruu55wds3w1451vibhs55)(ALL_HTTP,HTTP... UDL 2 - UDL. UDL. java oz.udl.db.ozuserdefinedlogger "ozudl.dll". FORCS Co., LTD 175
OZ API Developer's Guide (for.net) ( Web.config "OZDBHISTORY".) #region Using Statements using System; using System.Data; using System.Text; using System.Globalization; using System.Configuration; using System.Collections.Specialized; using System.Collections; using oz.dm.meta; using oz.udl; #endregion namespace oz.udl.db public class OZUserDefinedLogger : oz.udl.iuserdefinedlogger private string _name = "DB UDL"; private const string TableName = "OZDBHISTORY_NET"; private static readonly string[] FieldNames = "Time","Property", "SessionInfo", "IP", "UserID", "OdiName", "DataSetName", "DataStoreName"; private static readonly int[] FieldSizes = 0,int.MaxValue, int.maxvalue, 27, 255, 255, 255, 255 ; private static readonly bool[] Nullable = false,true, true, true, true, true, true, true ; // varchar's size must be specified private static readonly string[] FieldTypes = "date","text", "text", "varchar(27)", "varchar(255)", "varchar(255)", "varchar(255)", "varchar(255)"; private static readonly DbType[] FieldDbTypes = DbType.DateTime,DbType.String, DbType.String, DbType.String, DbType.String, DbType.String, DbType.String, DbType.String ; private IDbCommand _cmd; private string _cmdtext; 176 FORCS Co., LTD
public OZUserDefinedLogger() log) public void Init(oz.framework.db.OZConnection con, oz.framework.log.ozlog log.debug(_name, "Called init"); _cmd = con.connection.createcommand(); _cmd.commandtext = "select * from " + TableName; IDataReader reader = null; bool tableexists = true; try reader = _cmd.executereader(commandbehavior.schemaonly); catch(exception) tableexists = false; finally if(null!= reader) reader.close(); StringBuilder sb = new StringBuilder(); if(!!!tableexists) sb.append("create TABLE ").Append(TableName); sb.append('('); for(int i = 0; i < FieldNames.Length; i++) sb.append(fieldnames[i]).append(' '); sb.append(con.vendor.getfieldtype(fieldtypes[i])).append(' '); if(!!!nullable[i]) sb.append("not NULL"); if(i!= FieldNames.Length - 1) sb.append(','); sb.append(')'); _cmd.commandtext = sb.tostring(); _cmd.executenonquery(); log.debug(_name, "Success to create log table"); FORCS Co., LTD 177
OZ API Developer's Guide (for.net) sb.remove(0, sb.length); sb.append("insert INTO ").Append(TableName).Append(" VALUES("); for(int i = 0; i < FieldNames.Length; i++) sb.append(con.vendor.makeparametername(i)); if(i!= FieldNames.Length - 1) sb.append(','); sb.append(')'); _cmdtext = sb.tostring(); public string DbAlias get NameValueCollection values = (NameValueCollection)ConfigurationSettings.GetConfig("udl/db"); if(null == values) throw new Exception("Cannot find udl db configuration"); return values["alias"]; public void Trace(IUserDefinedLogTarget target, oz.framework.db.ozconnection con, oz.framework.log.ozlog log) log.debug(_name, "Called trace"); IDbCommand cmd = con.connection.createcommand(); for(int i = 0; i < FieldNames.Length; i++) IDbDataParameter param = cmd.createparameter(); param.parametername = con.vendor.makeparametername(i); param.dbtype = FieldDbTypes[i]; if(dbtype.string == param.dbtype) param.size = FieldSizes[i]; cmd.parameters.add(param); cmd.commandtext = _cmdtext; cmd.prepare(); StringBuilder sb = new StringBuilder(); foreach(idbdataparameter param in cmd.parameters) param.value = DBNull.Value; 178 FORCS Co., LTD
((IDbDataParameter)cmd.Parameters[0]).Value = DateTime.Now; IRDBLogTarget rdbstore = target as IRDBLogTarget; if(null!= rdbstore) sb.appendformat("[db Alias=0][IP Address=1][User ID=2][QueryType=3][Query=4][IsPrepared=5]", rdbstore.alias, rdbstore.ipaddress, rdbstore.userid, rdbstore.querytype, rdbstore.query, rdbstore.isprepared); if(rdbstore.isprepared) sb.append("[preparedvalues="); foreach(object o in rdbstore.preparedqueryvalues) sb.append(null == o? "null" : o is byte[]? "binary" : o.tostring()); sb.append(";"); sb.append("]"); sb.appendformat("[queryexetime=0][querystate=1]", rdbstore.queryexecutiontime, rdbstore.querystate); IProcedureLogTarget procestore = target as IProcedureLogTarget; if(procestore!= null) sb.appendformat("[dbalias=0][procedurename=1][procedureexecutetime=2][pro cedurestate=3]", procestore.alias,procestore.procedurename,procestore.procedureexecutetime,proce Store.ProcedureState); sb.append("[parameterlist="); IList list = procestore.parameterlist; foreach(ozprocedureparameter param in list) string paramname = param.name; string paramvalue = param.value; sb.append("name="); sb.append(paramname); sb.append(",value="); sb.append(paramvalue); sb.append(";"); FORCS Co., LTD 179
OZ API Developer's Guide (for.net) sb.append("]"); IUDSLogTarget udsstore = target as IUDSLogTarget; if(udsstore!=null) sb.appendformat("[executecommand=0][querytype=1][commandexecutetime=2][co mmandstate=3]", udsstore.executecommand,udsstore.querytype,udsstore.commandexecutetime,udsstore.commandstate); IFileStoreLogTarget filestore = target as IFileStoreLogTarget; if(filestore!=null) sb.appendformat("[filepath=0][fileaccesstime=1][fileaccessstate=2]]", filestore.filepath,filestore.fileaccesstime,filestore.fileaccesstime); IHTTPStoreLogTarget httpstore = target as IHTTPStoreLogTarget; if(httpstore!=null) sb.appendformat("[url=0][httpaccesstime=1][httpaccessstate=2]]", httpstore.url,httpstore.httpaccesstime,httpstore.httpaccessstate); IXMLLogTarget xmlstore = target as IXMLLogTarget; if(xmlstore!=null) sb.appendformat("[url=0][urlaccesstime=1][urlaccessstate=2]]", xmlstore.url,xmlstore.urlaccesstime,xmlstore.urlaccessstate); ISOAPLogTarget soapstore = target as ISOAPLogTarget; if(soapstore!=null) sb.appendformat("[servicename=0][port=1][endpoint=2][serviceexecutetime= 3][ServiceState=4][RequestXML=5]]", soapstore.servicename,soapstore.port,soapstore.endpoint,soapstore.serviceexecut 180 FORCS Co., LTD
etime,soapstore.servicestate,soapstore.requestxml); ISAPLogTarget sapstore = target as ISAPLogTarget; if(sapstore!=null) sb.appendformat("[functionname=0][functiontype=1][resultsettypes=2][funct ionexecutetime=3][functionstate=4]", sapstore.functionname,sapstore.functionstate,sapstore.resultsettypes,sapstore.f unctionexecutetime,sapstore.functionstate); IDictionary id = sapstore.inputparameters; IDictionaryEnumerator param = id.getenumerator(); sb.append("[inputparameters="); while(param.movenext()) sb.append("key="); sb.append(param.key); sb.append(",value="); sb.append(param.value); sb.append(";"); sb.append("]"); IClearQuestLogTarget clearstore = target as IClearQuestLogTarget; if(clearstore!=null) sb.appendformat("[executetype=0][querysubtype=1][query=2][queryexecutetim e=3][querystate=4]", clearstore.executetype,clearstore.querysubtype,clearstore.query,clearstore.quer yexecutetime,clearstore.querystate); ((IDbDataParameter)cmd.Parameters[1]).Value = sb.tostring(); IDMLogTarget datamodule = target as IDMLogTarget; if(null!= datamodule) ((IDbDataParameter)cmd.Parameters[3]).Value = datamodule.userid; ((IDbDataParameter)cmd.Parameters[4]).Value = datamodule.ipaddress; ((IDbDataParameter)cmd.Parameters[5]).Value = datamodule.odiname; ((IDbDataParameter)cmd.Parameters[6]).Value = datamodule.datasetname; ((IDbDataParameter)cmd.Parameters[7]).Value = FORCS Co., LTD 181
OZ API Developer's Guide (for.net) datamodule.datastorename; sb.remove(0, sb.length); NameValueCollection parameters = null!= target.httprequest? target.httprequest.params : null; if(null!= parameters) sb.append("[requestparams="); foreach(string key in parameters.allkeys) sb.appendformat("(0,1)", key, parameters[key]); sb.append("]"); System.Web.SessionState.HttpSessionState session = null!= target.httpcontext? target.httpcontext.session : null; if(null!= session) sb.append("[sessionattrs="); foreach(string key in session.keys) sb.appendformat("(0,1)", key, session[key]); ((IDbDataParameter)cmd.Parameters[2]).Value = sb.tostring(); log.debug(sb.tostring()); cmd.executenonquery(); log.debug("success to insert log information"); public class OZUserDefinedLogger2 private OZUserDefinedLogger _logger; public OZUserDefinedLogger2() _logger = new OZUserDefinedLogger(); log) [OZUDLInitialize] public void Init(oz.framework.db.OZConnection con, oz.framework.log.ozlog _logger.init(con, log); 182 FORCS Co., LTD
[OZUDLTrace] public void Trace(IUserDefinedLogTarget target, oz.framework.db.ozconnection con, oz.framework.log.ozlog log) _logger.trace(target, con, log); 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.OZUserDefinedLogger Web.config. ( db.properties DB "Sample ".) <?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <!--.Net Framework 2.0.Net Framework.--> <sectiongroup name="udl"> <section name="file" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="db" type="system.configuration.namevaluesectionhandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectiongroup> </configsections> <system.web> <httpruntime maxrequestlength="100000" /> </system.web> <udl> <file> <add key="path" value="c:/program Files/Forcs/50/OZ Server.NET 5.0/logs/UDL.Log" /> FORCS Co., LTD 183
OZ API Developer's Guide (for.net) <add key="layout" value="%dyyyy-mm-dd HH:mm:ss.fff [%-5p] %C1.%M - %m%n" /> <add key="daily" value="false" /> <add key="size" value="100kb" /> <add key="maxbackup" value="5" /> <!--add key="daily" value="true" /> <add key="pattern" value="yyyy-mm-dd" /--> </file> <db> <add key="alias" value="sample" /> </db> </udl> </configuration> OZ_HOME/conf/db.properties oz.udl.db.ozuserdefinedlogger. # # Sample # Sample.vendor=MSSQL Sample.serverAddress=127.0.0.1 Sample.user=user Sample.password=userpw Sample.portNo=1433 Sample.dbName=DBName Sample.maxconns=20 Sample.initconns=5 Sample.timeout=5 Sample.doConnectionCheck=false.. 184 FORCS Co., LTD
[Data Action]. ODI. UDL 3 - OZ UDL monitor.log. UDL monitor.log. java FORCS Co., LTD 185