Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The fastest way to fetch PropertyTemplate by symbolic name ising IBM FileNet CE API

The only way I know is to iterate through property templates of object store and find the one I need by comparing 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 object store has a plenty of property templates, it could be rather slow. Any ideas? I'm using CE API 5.1

like image 719
sermolaev Avatar asked Sep 12 '13 05:09

sermolaev


1 Answers

You can search for it by symbolic name:

SELECT This FROM PropertyTemplate WHERE (SymbolicName = 'DocumentTitle')
like image 156
ᄂ ᄀ Avatar answered Oct 20 '22 15:10

ᄂ ᄀ