Opened 10 years ago

Closed 10 years ago

#9077 closed enhancement (fixed)

ItemFileReadStore should have an option to assume a flat data store

Reported by: Phil DeJarnett Owned by: Jared Jurkiewicz
Priority: low Milestone: 1.4
Component: Data Version: 1.3.0
Keywords: ItemFileReadStore ItemFileWriteStore Cc:
Blocked By: Blocking:

Description

ItemFileReadStore? currently assumes that it might be loading a hierarchical data store, and loads any object as a nested item within the containing item.

Even though this is the "expected" behavior, this can cause problems in two ways:

1) New users to the system attempting to store complex data into a node are often confused as to why a simple object has been changed (such that the properties of that object have all been converted to arrays). There are at least 2 filed-and-closed bugs in the database already about this.

2) If a developer is switching between different DataStores?, for example, the QueryReadStore? and the ItemFileReadStore? depending on need, completely different and unexpected things happen. (In my case, I use a QueryReadStore? for displaying values in a Grid, and ItemFileReadStore? when those items are being edited on a different page. They are both served by the same server-side controller.)

Since only ItemFileReadStore? supports the complex typeMap, that isn't a very good solution in 2, and is overly complex in 1. In many ways, the store has been overcomplicated for a less-common usage, namely hierarchical stores.

I propose a new property on ItemFileReadStore?, flatStore, which defaults to false (for compatibility). When this is true, the isItem method should always return false, preventing value-items from being added as a child node, and instead they are simply stored as a single value (or array of values) for the item.

Attachments (2)

hierarchy_disable.patch (8.1 KB) - added by Jared Jurkiewicz 10 years ago.
Patch to allow disabling of parsing 'child' object structures as items.
AndOr_hierarchy_disable.patch (10.5 KB) - added by Jared Jurkiewicz 10 years ago.
Same patch for AndOr? store.

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Jared Jurkiewicz

Attachment: hierarchy_disable.patch added

Patch to allow disabling of parsing 'child' object structures as items.

Changed 10 years ago by Jared Jurkiewicz

Same patch for AndOr? store.

comment:2 Changed 10 years ago by Jared Jurkiewicz

Fixed in revisions: [17245] and [17246]

comment:3 Changed 10 years ago by Jared Jurkiewicz

Milestone: tbd1.4
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.