You are here

P8 4: The 5 most common mistakes

We have been working with the new File P8 Daphne API for quite a while now, in our own product development and also in customer projects. I noticed that there are some pitfalls that can cause some trouble if you are new to Filenet or Daphne. This article tries to list the 5 most important mistakes you can make:

  1. Do not screw up security !
    The security / authentication model used by Daphne is different from the previous one used in Buzz. Many people make the mistake to just set up a UserContext and do not keep track of that context. Especially in J2EE applications, this will allow other applications in the same VM to use your context when the app server reuses your thread. I already wrote a full article about this problem in a previous blog post: xxxxx.
    Many people just follow FileNets sample code and screw up the UserContext.
  2. Object IDs are NOT unique
    Although FileNet is using GUIDs (global UNIQUE identifier), they are not unique in the ObjectStore. It is only guaranteed that an object ID is unique within its class. But there can be objects of a different class in the same ObjectStore that have the same ID. When creating a property from a template for example, FileNet creates a new object of a PropertyDescription sub-class that has the same ID as the PropertyTemplate object.
    To get a unique identifier within an ObjectStore, you need to combine the ID of the class and the ID of the object.
  3. Prevent caching of class- and property descriptions
    Many people try to increae the performance of their application by caching class and property meta data, especially the ClassDescription and PropertyDescription objects. In doing so, you need to take special care about the current user. Parts of these objects are user specific and must not be shared across different users.
    But the FileNet Daphne API already comes with a sophisticated caching mechanism for Object store metadata. When fetching the ClassDescription of an object or when trying to get the class tree, the Daphne API does not necessarily run a round-trip to the CE server. In many cases it is able to fulfill the request with information from its local cache.
    You should rely on this Filenet provided mechanism first unless you EXACTLY know what you are doing and WHY are are doing it.
  4. Do not expect objects to have an ID
    All objects you typically deal with - like Documents, Folders or CustomObjects - do have an ID property. So people simply ignore the fact that this property is not defined in the GenericObject root class, but in all sub classes of Subscribable instead.
  5. Respect the scope of Objects and classes