I want to do Spring expression evaluation against a root object that is a hierarchy of Maps, Lists, and primitive objects. Is there any way to selectively make parts of the hierarchy read-only and other parts writeable with SpEL? Thanks!
Related
I have some JSON data that I've deserialized to a hierarchical structure or Map<String, Object>. I want to access some of this data via SpEL as read-only, and some of it as writeable, based on certain parent properties. For example, let's say that all child properties of "readOnlyGroup" should be read-only, and "writeableGroup" should be writeable. So, "readOnlyGroup.prop1.prop2.prop3" should be read-only, and "writeableGroup.prop1.prop2.prop3" should be writeable. I see that PropertyAccessor supports canRead() and canWrite(), but I'm not seeing how I can use this to enforce these constraints on child properties, without having PropertyAccessors for every child object -- which would be difficult anyway since they're just Maps. Thoughts? Thanks!
I wrote a script that loads data from 2 tables.
Using this script I need to just match corresponding elements in these 2 columns.
I am using angular-ui-tree for managing columns, but can't come up with an idea how to visually and programmatically match corresponding elements between 2 trees?
Thanks
Not quite sure what is your problem here. I assuming by "matching visually" you do not mean you need some AI API to actually do visual match, so you just want to get objects that are in the same location in the UI tree?
Using $nodeScope (type: Scope of ui-tree-node) should give you that information, as the property of $nodeScope is something like "1.1.1" or "1.1.2" etc. So you can just parse the "parent" node to get all children belonging to same node.
Scope also has a method isParent(nodeScope) which can check if a certain node (that calls the method) is a parent of targeted node. Similarly Scope has isSibling(targetNodeScope) and isChild(targetNodeScope) methods to help you identify the relationships. As a general guide, you just follow the (array) of nodes in a (nested) loop and pick the elements or objects you need. You can pick the objects from both UI trees at the same time, so they should be from the same node at that point.
I have 8 SSIS packages in a project with different variables. Is there an easy way to print all variables names, scope, DataType, Value, Expression for the whole project?
At this time I am manually typing each variable sheet into excel for audit.
Thank you for your help
Are you open to using C# or a .Net language? If so, you can use the SSIS Object Model to iterate over the variables as needed.
All Control Flow Task Hosts inherit from DtsContainer. DtsContainer contains a property called Variables, which is a collection of variables in the scope of that container.
So by starting with a Package object, you can get the Package object and all the children (and children of those children, if needed, recursively) as DtsContainer objects. You can get the children of the current object by casting it to IDTSSequence and then accessing the Executables property. Once you have the collection of all the Executables (the package, and children of children) as DtsContainers, you can then access the Variables property of each Container object, over which you can then iterate as you need.
I have uploaded a C# script that does the above here. https://gist.github.com/samskolli/974eaaf9d1bd72fb3ee8bb202e49a058
I have a GAE application, where I'm using the geomodel for a location based model in my database. There are two "types" of this model, however, they need to be geo-queryed together as one. The two "types" share a set of base properties, but the second type has a few more. Is there any way I can make those other properties optional rather than just setting them to bogus values?
Inside the datastore, entities are independent of each other. You can have different entities of the same Kind that have different sets of attributes. This happens very commonly if you add some new attributes on a new version of your app, and the entities that already exist in the datastore won't have those attributes.
In your code though, for any given version you end up declaring a single Model for your Kind. You can choose not to assign values to certain attributes for the different types.
Simply make sure that your code properly handles cases where attributes don't exist, or are set to None.
I'm interested in using db4o as my persistence mechanism in my Desktop application but I'm concerned about a couple things.
1st concern: Accidentally clipping very complex object graphs.
Say I have a tree with a height of 10 and I fetch the root, how does it handle me storing the root object again?
From my understanding, it doesn't fetch the entire tree it fetches the first 5 referenced layers.
So.. If I make a trivial change to the root and then store it, will it clip away the nodes further down the tree, in essence deleting them.
If not.. how does it handle this?
2nd concern: Extracting subgraphs in a larger object graph
Using my tree example from above... If the database contains 1 massive tree can I query for a single node within it? Since .store was called only once, does my database think it contains only 1 "record"?
Thank you.
You have to be very careful, because two things can happen: you can pull whole db into memory, or just partial graph (rest of objects will be null).
In db4o there's notion of Activator and Update depth, which can be configured upon dbv40 configuration, or when objects are fetched. Its the way you tell db40 how deep you want him to go when fetching referenced objects. Check db4o web site, there's documentation about it:
http://developer.db4o.com/Resources/view.aspx/Reference/Object_Lifecycle/Activation
http://developer.db4o.com/Resources/view.aspx/Reference/Object_Lifecycle/Update_Depth
DB4O's Transparent Activation should resolve most of the fears you've expressed here.