collection inside a collection in json store ibm worklight - ibm-mobilefirst

Is it possible to define or declare a collection inside another collection in json store IBM worklight. like- Objects will have sub objects. Let me know the API or whatever syntax needs to be followed.
Thanks in Advance.

I don't see why not. You could just simply stringify the JSONStore collection object and store it as a record in another collection, but if you are talking about joining two different collection using a common index you can do that using additional search fields. I created a blog just for this. Blog Post

Related

CKAN: how do I update/create the data dictionary of a resource using the api?

My company is using a CKAN instance configured with Data Store and DataPusher. When a CSV file is uploaded to CKAN, DataPusher sends it to the DataStore and creates a default Data Dictionary for the resource. The Data Dictionary is a very nice feature to display the description of data fields for the users. Here is an example (it is in Brazilian Portuguese):
I can update the Data Dictionary using the UI, or it can be sent as part of the Fields passed to datastore_create().
My problem, is that I don't control the call of datastore_create() because this method is automatically called buy the DataPusher service.
I want to programmatically set the values of the Data Dictionary, but I can't find the api call that allows me to do it. An api call that update the Fields metadata. Can I do it using the Api? Or maybe it is possible create it when I create the data resource. I'd like a code example.
You can use the API call datastore_create on top of an existing table. This will not impact the data in the table.
You should use the datastore_search to check the format of how the dictionary is saved in one of your resources (result->fields->info). Use that as your base, make the desired changes, and use it in the body of the datastore_create call.
Unfortunately, the API call datastore_info does not give you back that information.
The majority of the CKAN UI functionalities can be made through the API as well. In this case, you can make use of the "datastore_create" by the controller --> See Code here.

Custom PropertyVersions for observed data

Does anyone know if it is possible to create custom property version for observed data using Ocean?
I'd like to store 2 sets of observed values based on the same template.
Cheers,
Neal
Sorry, but neither Petrel nor Ocean provides this functionality. You can use the only predefined ObservedDataVersionSelection[s], the list of available options can be obtained via Petrel's import data dialog or you can retrieve it programmatically via ObservedDataSetForWell.AllObservedDataVersionSelections (Note: you can retrieve this list from any ObservedDataSetForWell, e.g. you can get it from a just created and "empty" set)

How to update item of List without modifying its Modified date in SharePoint online with Client Object Model

I am using Client Object Model to update property of items in a list of SharePoint online. My requirement is to update Title field of item without changing or affecting the modified date of item using Client Object Model.
Thanks
Prakash
The Managed Client Object Model have "limitation" with regards to the way a List Item Update works - that is there is no SystemUpdate type functionality available like in the 'full' SharePoint Object Model.
What I can suggest is that if you really want this functionality, write your own custom web service that updates the document metadata using SystemUpdate so a new version isn't created and deploy it to your SharePoint Server. This will allow you to call your custom web service from your code and will satisfy your requirements.
I hope this helps
If we Check
ListItem methods regarding Microsoft.SharePoint.Client
msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem_methods.aspx
and
SPListItem Methods regarding Microsoft.SharePoint.
msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.listitem_methods.aspx
The method "SysytemUpdate" is only present in Microsoft.SharePoint SPListItem class but not under Microsoft.Sharepoint.Client ListItem class. So, from clent object model we cannot update list data without affecting modifying date.
you can check client object model post in my blog
Thanks,
Adi
SharePoint Codes

Post to Sharepoint List using Objective C

I'm fairly new to programming in Objective C. I am trying to post an item to a Sharepoint list. The way that I have to post to this is to overlay another object in the list, but also to create a new object right after that. I'm a bit confused on what to do and have already made a connection to the list to receive data from it, but do not know how to post to it.
Any help is greatly appreciated.
SharePoint's List Web Service has the methods that allows you to create new items. Check this MSDN reference.

When should an object be included as a member of another object, and when should it always standalone?

An example problem:
On Stack Overflow, a question page shows a number of different answers. In displaying these answers, the site also gives information about the author of the answer. This means that although the number of badges a given user has has nothing to do with an answer in and of itself, that data still needs to be retrieved in order to display the page.
From what I can see, there are three different ways to go about pulling this view data in a model:
A Post object could include a full User object as a member. The view would then access the user like this: $post->user->getReputation(). This seems cleaner, since a Controller could just request the posts and be done with it, but yet inefficient since a Post probably doesn't always need a full-blown User. I suppose it works well enough if the User object is relatively light, which it probably would be. The problem would then be that you would need to duplicate User retrieval code as part of the Post retrieval query.
The Post object could hold just an ID for a User. When the Post, or Posts, are returned to the Controller, the Controller could then extract the unique User IDs from the returned set and pass them to a User factory. The returned User objects would then be passed along with the original Posts set to the View as a separate collection. The view could then grab user info using something like $users[$post->getUserId()]->getReputation().
A hybrid approach: Include the User object inside the Post object, but have the unique id extraction and User retrieval as part of the Post retrieval method. i.e. Post::getPosts() would grab all relevant posts and convert them to objects with null User members, then it'd extract all user ids and pass them to User::getUsers(), then assign the Users to the relevant Posts before returning the set of Posts to the caller.
I guess what I'm getting at is, how do I know when an object needs to contain another object fundamentally? Is it unclean/a code smell to instead have such related objects returned separately, with neither object knowing the other has been retrieved. I'm leaning towards the separate retrieval concept - it seems the most efficient - but it really does feel like they're too related for that to make sense.
There is also a solution in between 1 and 2. You can have a lazy loading proxy for the user class. With this solution you can have best of both worlds because the proxy is interchangeable with the real thing so depending on the situation you can have the object itself or the proxy.
Edit:
I'll try to explain this with an example.
Say that you have a view where you don't need user info, then you can instruct/configure your post factory to use the lazy proxy (see wikipedia)for the user which will only contain an ID. So no access to users is needed.
In another view you occasionally need to access user info but only for some posts, here again you instruct/configure your factory to include the lazy proxy for the user.
But when you actually need access to the user info, you can access the proxy object that will then load the actual user object and redirect messages to it.
In yet another view you need both post and user info, so here you instruct your post factory to use actual user objects.
It seems to me that this is another case of dependency injection. A general enough idea that could help you.
DEPENDENCY INJECTION WIKI
Read something about the Inversion Of Control also.
why not add optional member to model to know informations?? you can ignore when you don't need and can use when you do need.