Topic
  • 2 replies
  • Latest Post - ‏2012-06-05T16:45:21Z by TigerTrix
Pratz25
Pratz25
8 Posts

Pinned topic Property of Document class

‏2012-06-05T07:53:43Z |
Hi

I have a problem in getting the getPropertyDefinitions() of a document class.
For example of document class , property are to , from ,cc;sent on etc. which are already available in content manager.

now I created my own property name 'delivered' but i can't able to retrive the 'delivered' property.
with this code i am able to see the availble property not user created property.

how to print user created property.

public void getDocumentClass() {
ItemIterable<ObjectType> v = session.getTypeChildren("cmis:document", true);
Iterator<ObjectType> i = v.iterator();

while(i.hasNext()){

ObjectType a = i.next();
if(a!=null){

Map<String, PropertyDefinition<?>> d = a.getPropertyDefinitions();
Iterator<String> itr = d.keySet().iterator();
while(itr.hasNext()){

String key = itr.next().toString();
if (Boolean.FALSE.equals(d.get(key).isInherited())) {

PropertyDefinition<?> value = d.get(key);
System.out.println(" "+key +" "+value.getDisplayName());
}
}
}
}
}
Updated on 2012-06-05T16:45:21Z at 2012-06-05T16:45:21Z by TigerTrix
  • jay.brown
    jay.brown
    41 Posts

    Re: Property of Document class

    ‏2012-06-05T15:00:13Z  
    For FileNet (P8) CMIS there is a default 60 minute TTL on the metadata cache. FileNet metadata can be very large and thus expensive to retrieve, so the FN CMIS server caches it for you. There is also a Chemistry OpenCMIS client side cache for metadata in play here which has an infinite ttl for metadata.

    1. For the FN CMIS server you can get around this by either waiting 60 minutes or restarting the server.

    2. For the OpenCMIS API you will need to create a new session (which will have a new cache). This must take place after #1 has completed.
  • TigerTrix
    TigerTrix
    38 Posts

    Re: Property of Document class

    ‏2012-06-05T16:45:21Z  
    • jay.brown
    • ‏2012-06-05T15:00:13Z
    For FileNet (P8) CMIS there is a default 60 minute TTL on the metadata cache. FileNet metadata can be very large and thus expensive to retrieve, so the FN CMIS server caches it for you. There is also a Chemistry OpenCMIS client side cache for metadata in play here which has an infinite ttl for metadata.

    1. For the FN CMIS server you can get around this by either waiting 60 minutes or restarting the server.

    2. For the OpenCMIS API you will need to create a new session (which will have a new cache). This must take place after #1 has completed.
    For CM8, in the current release, the CMCMIS mid-tier cache will not pick up the new property until you restart CMCMIS. Just restart the WebSphere server/profile to be safe. It actually caches by pooled connections per user, so logging on as a new user that had not previously connected might see the new property.

    I assume you will take care of the application-side cache refresh or new session as stated in the previous comment.

    A very quick test to see if the property appears is to just use the types URL directly in a browser. Go to the services page if you forget the base URLs which you can find at the bottom, open the one for the base types, then change for the specific base class you want, append either "cmis:document" or "cmis:folder" and it should list the respective types. Then CTRL+U (in FireFox) to see the XML source and its properties. Then you will know if the server is reporting them and only a matter of using the API correctly that you are using.

    Remember that for cmis:document itself, new custom properties will never appear on the virtual base class, even if you default new instances of cmis:document to actually create instances of a real sub type, like example CmisDocument (by documentTypeGlobalDefault config setting). But actual type CmisDocument would list the custom properties once instantiated.