The fastest way to get a PropertyTemplate by symbolic name is the IBM FileNet CE API

The only way I know is to iterate over the object storage property templates and find the one I need by comparing the symbolic name with some string:

String propertySymName = "someName"; ObjectStore os = Factory.ObjectStore.fetchInstance(...); //assume object store is fetched correctly String[] properties = {PropertyNames.PROPERTY_TEMPLATES}; os.fetchProperties(properties); PropertyTemplateSet propertyTemplates = os.get_PropertyTemplates(); Iterator<?> iterator = propertyTemplates.iterator(); while (iterator.hasNext()) { PropertyTemplate propertyTemplate = (PropertyTemplate) iterator.next(); String[] arg = {PropertyNames.SYMBOLIC_NAME}; propertyTemplate.refresh(arg); if (propertyTemplate.get_SymbolicName().equals(propertySymName)) { //do some stuff } } 

But if there are many property templates in the object store, this can be quite slow. Any ideas? I am using CE API 5.1

+6
source share
1 answer

You can find it by its symbolic name:

 SELECT This FROM PropertyTemplate WHERE (SymbolicName = 'DocumentTitle') 
+8
source

Source: https://habr.com/ru/post/953675/


All Articles