Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Date constraints in ListObjects call?
Pfizer_Developers
Hello,I'm developing a Java application to extract objects from a LiveLink repository, and I need to be able to support a 'delta' mode, where the only objects extracted are those that were modified after the previous extraction run. The obvious way seems to be to use the same 'ListObjects' call that I use when extracting everything, but to add a date constraint to the 'queryStr' parameter, thus: String queryConstraints = "(SubType=" + LAPI_DOCUMENTS.DOCUMENTSUBTYPE + " or SubType=" + LAPI_DOCUMENTS.COMPOUNDDOCUMENTSUBTYPE + ")"; try { if (extractionMode.equalsIgnoreCase("delta")) { DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); prevTimeStampVal = dateFormat.parse(previousTimeStamp); queryConstraints = queryConstraints + " and ModifyDate > " + prevTimeStampVal.getTime(); } result = documents.ListObjects(volumeId, nodeId, "", queryConstraints, LAPI_DOCUMENTS.PERM_SEE, objects); if (result == 0) {This logic works just fine when I'm running in 'extract-everything' mode, but when I add the date constraint, I invariably get a non-zero result back. I've tried all sorts of variations on the value that gets compared to the ModifyDate -- integer, string, LLValue, ... -- but it behaves the same with all of them. Can anyone tell me how to accomplish this?Thanks,sje
Find more posts tagged with
Comments
Rolf_Poser_(eu0018377_-_(deleted))
Dear sje:Are you using Oracle? The querystr you pass in via LAPI will be added intoa SQL statement performed against the DB - you may need to specifyappropriate date formatting information for oracle to interpret it correctly.My suggestion would be to try and write the sql statement first, somethinglike :select dataid, name from Dtree where parentid= where to see that it returns the correct results.At least I think this might be what you need to do :-)Rolf.
Pfizer_Developers
Rolf,Thanks for the suggestion. The underlying database apparently *is* Oracle -- at least for the instance I'm testing against -- so I'll see if I can get connected directly, and try to figure it out that way.Regards,sje