Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Dataservice local AIR cache - User SQLite Query Possible??

Avatar

Level 2

Hi All

Does anyone know if it is possible to query against offline cachid database (created by dataservices 2.6.1 and AIR 1.5.x)

So, for example I need to do something like:

SELECT * from STOCKTABLE WHERE STOCKTABE.NAME LIKE %myproductname%

The main reason I need to do this is, because I need to use the sql 'LIKE' keyword, rather than program my own 'smart' search routines...

Having loaded the dataservice cacheid db file, I can query against a table some tables but it seems obvious that the schema is not designed for users (like myself) to load and query against...but still worth asking:)

Any help, much appreciated.

Jasen

4 Replies

Avatar

Former Community Member

Jasen, try LiveCycle Data Service 3.1 released earlier this week. We have significantly enhanced the offline

functionality allowing you to use Data Management and JPQL to run local queries.

Anil

Avatar

Level 2

Anil

Thankyou for your reply, sorry it took sooo long for me to acknowledge it:)

Unfornately, we do have access to DS3.1, we only have access to 2.61 ATM.

To get around this issue, we are using AdvancedDataGrid and using field sort for three fields. This is on 5000 or so items of flat data and it takes some time to complete the update (Apparently AIR2 has faster routines, but not sure how much faster...)

Look forward to having access to DS3.1 at some time in the future...but until then 2.61 is it.

Just to relaborate, we need to build a hiearchical tree from flat data,for example:

                 groupingCollection    =    new GroupingCollection();
                 grouping    =    new Grouping();
                 fields        =     new Array();

                 fields.push(new GroupingField( "web_Category_Level_1", true ));
                 fields.push(new GroupingField( "web_Category_Level_2", true ));
                 fields.push(new GroupingField( "web_Category_Level_3", true ));//this field is not always present

                 grouping.fields    =    fields;

                 groupingCollection.grouping    =    grouping;
               
                 groupingCollection.refresh(true);

However, some fields in the flat data only have two fields, thus only giving two levels in the tree, but I am not sure how to sort for two fields and/or three fields in the flat data returned from a dataService.fill().

Had looked into compare groupingObjectFunction and groupingCompareFunction but did not have much luck...

So, that is why I was hoping to be able to query the local dataservice cache directly and build the tree using lazy loading methods (just like using SQL queries on a remote server)

Cheers

jvm

Avatar

Former Community Member

I am not sure there is a way around your problem with LCDS 2.6.1 - 2.6.1 stores data in the local database as blobs and cannot be queried. As I had mentioned, this has been enhanced in 3.1 - now the data is stored in table and can be queried. If you are using Model Driven Development, the tool also generates the offline adapter to interact with the local database.

-Anil

Avatar

Level 2

Thanks Anil

I have posted a question in the flex forum asking for help with the sorting of either two/three fields.

http://forums.adobe.com/thread/656879

Jasenvm