Saturday, February 27, 2021

FileNet API - Getting an ObjectStore Object


Getting ObjectStore 


        An object store is represented by the ObjectStore class in the Content Engine API.
 You can use static methods on the Factory inner classes to create instances of ObjectStore.
 Use createInstance to create a new instance of an ObjectStore object.

The pattern for getting an ObjectStore is as follows - 

ObjectStore

  • Get a Connection object.
  • Get a Domain object.
  • Get an ObjectStore object.
  1. Connection Object : Get to the Connection code
  2. Get the Domain Object as shown in 3 rd step.
  3. The Below code is to  Create Object for Object Store,
             Domain domain = Factory.Domain.fetchInstance(connection, null, null);
             ObjectStore objectStore = Factory.ObjectStore.fetchInstance(domain, "your domain name", null);


            Use getInstance or fetchInstance to retrieve an existing instance of an ObjectStore object.
The difference between these two methods is that getInstance does not verify the existence of the requested object on the server; it returns a local reference to the object, which is not affiliated with a server object until you perform a function on the object.
The fetchInstance method, however, immediately makes a round trip to the server to retrieve the property values of the ObjectStore object. 
 

No comments:

Post a Comment