Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 536.4K On-Premises Infrastructure
- 138.3K Analytics Software
- 38.6K Application Development Software
- 5.8K Cloud Platform
- 109.5K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71.1K Infrastructure Software
- 105.3K Integration
- 41.6K Security Software
Creating iFS Objects Programtically

3004
Member Posts: 204,171 Green Ribbon
Is there a way to create instances of iFS objects programatically from a client (other than by building XML files on the fly and dropping them on iFS) or from within the database? I'd rather not use the XML approach because it is not transactional across instances (i.e. if I want to create 100 instances I would need 100 XML files and dropping each one on iFS would result in a commit).
Comments
-
Absolutely. The general pattern for creating a persistent object is as follows:
// connect to iFS
LibrarySession mySession = LibraryService.connect(/* ... */);
// define the object to be created (replace <ObjectName> with the name of the iFS object you wish to create, such as PublicObject or Folder)
<ObjectName>Definition def = new <ObjectName>Definition(mySession);
def.set<attribute>(/*...*/);
// create the object
<ObjectName> obj = mySession.create<ObjectName>(def);
A development kit will be posted shortly; it will include much more information. -
oops -- typed too fast. The last part, where you create the object (create<ObjectName> method on class LibrarySession) should be:
mySession.createPublicObject(def);
This is of course limited to subclasses of PublicObject -- the most common type of object you will create.
This discussion has been closed.