tcOBJ service

Manage Resource Objects

Interface class

com.thortech.xl.ejb.interfaces.tcOBJ

Create Resource

Create a brand-new Resource Object named MyResource:

tcOBJ service = (tcOBJ) getService(tcOBJ.class);
service.initialize("", new byte[0]);
 
service.setString("obj_name", "MyResource");
service.setString("obj_type", "Application");
service.setString("obj_order_for", "U");            // Order for User
service.setString("obj_allow_multiple", "0");       // Allow Multiple 0/1
service.setString("obj_self_request_allowed", "0"); // self request allowed 0/1
service.setString("obj_autosave", "0");
service.setString("obj_allowall", "1");
service.setString("obj_autolaunch", "1");
service.setString("obj_objadminonly", "0");         // Provision by Object Admin Only 0/1
service.setString("obj_auto_prepop", "0");
service.setString("obj_trusted_source", "1");
 
service.save();

Note: The object created has same children as the minimal Resource Object created with designconsole.

Find Resource by name

Load object named MyResource and print it's key:

tcDataBase provider = getService(tcDataBase.class);
tcDataSetData data = provider.readStatement("select * from obj where obj_name='MyResource'");
tcOBJ service = (tcOBJ) getService(tcOBJ.class);
service.loadDataSetData(data);
System.err.println(service.getLong("obj_key"));
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License