How to Update Embedded map in orientdb? - orientdb

I have a embedded map entry in my DB class as follows.
Json string:
{
"dataStep2": "{stepno: 2,content:'', icon:'plug icon', color:'olive', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}",
"dataStep3": "{stepno: 3,content:'', icon:'plug icon', color:'blue', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}"
}
I want to update only one part oe embedded map. For a example "datastep2" values.
Please Advice me to do this.
Thanks in advance.

You can use this query:
update #24:0 set embed.dataStep2="{stepno: 2,content:'', icon:'plug icon', color:'green', header:'Uptime Guarantee',headcolor:'ffffff', tagline:'Check out our plug-in marketplace',taglinecolor:'ffffff', isActive:true}"
Where #24:0 is a rid of the record that you want to update, and embed is the property containing EMBEDDEDMAP data with dataStep2 and dataStep3 from your example.

Related

How to add another DataSource in prompt Query?

I want to add another data source in Query prompt.
When I launch a form I open the prompt Query.
In my form init method I have:
QueryRun queryRun;
super();
queryRun = new QueryRun(TableA_ds.query());
if (! queryRun.prompt())
{
element.close();
}
TableA_ds.query(queryRun.query());
In my Form data source, in init method, I have put this code to set my query range:
tableA_ds.query().dataSourceTable(tablenum(TableA)).addRange(fieldnum(TableA,FieldtableA)).value(SysQuery::valueUnlimited() );
I want to add another data source (another table) - TableB.
I used this code:
purchLine_ds.query().dataSourceTable(tablenum(TableB)).addRange(fieldnum(TableB,FieldtableB)).value(SysQuery::valueUnlimited() );
But when I launch a Form I view only record query range from TableA
Relation of TableA to TableB is on field PurchId.
I want to see two ranges. Can someone help me?
Thanks for your time.
Enjoy!
I think you can add another datasource with:
purchLine_ds.query().dataSourcetable(TableA).addDatasource(tablenum(TableB);
purchLine_ds.query().dataSourcetable(TableB).relations(true)
Thanks Alex , for your Help,
I used this code,
in my Form init Method :
query q = new Query();
QueryBuildDataSource qbds, qbds2;
QueryRun queryRun;
qbds = Q.addDataSource(tableNum(TableA));
qbds.addRange(fieldnum(TableA,Field1TableA)).value(SysQuery::valueUnlimited());
qbds2 = qbds.addDataSource(tableNum(TableB));
qbds2.relations(true);
and launch the query ,
work well,
enjoy!

How to add a where clause to fetchAll in Zend

I'm trying to return an array of objects like I used to do in CodeIgniter, but now I'm using Zend Framework. I'm very new at it. I want to add a where clause to fetchAll(). I tried:
$objDocs = new Studyclub_Meetings_Docs();
$this->view->arrDocs = $objDocs->fetchAll(array('meeting_id' => $intMeetingId));
but that returns an array of arrays. How do I return an array of objects? I'm using ZF 1.x.
Zend_Db_Adapter_Abstract::fetchAll() which appears to be the variant of fetchAll() you are using accepts a third argument: $fetchMode
You probably just need to adjust your code to specify the fetch mode you prefer:
$objDocs = new Studyclub_Meetings_Docs();
$this->view->arrDocs = $objDocs->fetchAll(array('meeting_id' => $intMeetingId), Zend_Db::FETCH_OBJ);
Good Luck!

Programatic CellTable sort in GWT not working

I'm using the ListDataProvider example here as a guide. The columns are sorting fine as expectd based on the provided comparators. I'm trying to programatically apply a sort as alluded to on this line from the example:
// We know that the data is sorted alphabetically by default.
table.getColumnSortList().push(nameColumn);
What this does, is it makes the cell column appear to be sorted with the carrot sort indicator. However, the underlying data isn't sorted. Is there a way to get the table to actually apply the sort progarmatically. I suppose I could use this in conjunction with actually sorting the data via Collections.sort(), but I'd like to avoid that and do it in one place.
You can apply sorting on a column programatically with little exta code. The following code snippet does that -
When ever u set data to the cellTable you have to initialize the ListHandler as below code does -
cellTable.addColumnSortHandler( createColumnSortHandler() );
private ListHandler<T> createColumnSortHandler()
{
final ListHandler<T> listHandler = new ListHandler<T>(listDataProvider.getList());
listHandler.setComparator( sortColumn, comparator );
return listHandler;
}
And when u want to fire the SortEvent execute the following code snippet -
ColumnSortInfo columnSortInfo = new ColumnSortInfo( sortColumn, sortDirection );
cellTable.getColumnSortList().push( columnSortInfo );
ColumnSortEvent.fire( cellTable, cellTable.getColumnSortList());
you have to call setData on grid again.....

How to access element and elementId from within didInsertElement

Using Ember.CollectionView I want to access and manipulate the DOM element which is being inserted by each child view. The issue I have is that I don’t know how to get a reference to the element from within didInsertElement. Here is the jsFiddle -- the summery of coffeescript is below:
window.App = Ember.Application.create()
window.App.initialize()
App.Item = Em.View.extend
didInsertElement: () ->
console.log ">>> element is: ", this.element
App.items = Em.ArrayController.create()
App.items.set('content',[
Em.Object.create({title:"AN", id:"item-one"}),
Em.Object.create({title:"Epic", id:"item-two"}),
Em.Object.create({title:"View", id:"item-three"})
])
App.EpicView = Ember.CollectionView.extend
classNames: ['epic-view']
contentBinding: 'App.items'
itemViewClass: 'App.Item'
this.element is undefined. I have also tried calling element and that is undefined as well. According to the docs, there is an element property available inside the view, but I don’t know how to access it, and I am not sure if it is available from within didInsertElement or not.
How can I get the id of the DOM element that was just inserted into the view? Ideally, I would like not having to search for it in the DOM since the view should already be aware of what it is inserting into the DOM.
ps: I am using Ember 1.0pre
Use get('element') or get('elementId') to access properties in Ember

sencha touch 2.0 : How to create a form from a model

Is there an easy way to automatically generate a form panel (I mean the fields and the values), given a model and a store?
Create an instance of your model, then iterate through the empty data object adding input fields to the form panel, this code won't work because the Form.Panel isn't added to anything but you should be able to get the idea.
var objModel = Ext.create('app.model.objModel'),
fp = Ext.create('Ext.form.Panel');
Ext.iterate(objModel.data, function (item) {
fp.add({xtype: 'textfield', name: item, label: item});
}