Forum Stats

  • 3,852,601 Users
  • 2,264,121 Discussions


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).


  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    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);

    // create the object
    <ObjectName> obj = mySession.create<ObjectName>(def);

    A development kit will be posted shortly; it will include much more information.
  • 3004
    3004 Member Posts: 204,171 Green Ribbon
    oops -- typed too fast. The last part, where you create the object (create<ObjectName> method on class LibrarySession) should be:


    This is of course limited to subclasses of PublicObject -- the most common type of object you will create.
This discussion has been closed.