I am trying to import data from Document DB to solr-5.4.1.
Full import is executing properly but delta import is not working. When I execute delta import nothing happens
Here is the current delta configuration
deltaQuery="{'lastUpdatedDate':{$exists:true},'lastUpdatedDate':{$gt: Date('${dih.last_index_time}')}}"
deltaImportQuery="{'_id':'${dih.delta._id}'}">
whole db-data-config.xml
<dataConfig>
<propertyWriter dateFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" type="SimplePropertiesWriter" filename="dataimport.properties"/>
<document name="tvTitleSearch">
<entity name="tvTitleSearch"
processor="MongoEntityProcessor"
query=""
collection="tvTitleSearch"
datasource="MyMongo"
transformer="MongoMapperTransformer"
deltaQuery="{'lastUpdatedDate':{$exists:true},'lastUpdatedDate':{$gt: Date('${dih.last_index_time}')}}"
deltaImportQuery="{'_id':'${dih.delta._id}'}">
<field name="id" column="_id" indexed="true" type="uuid" stored="true" mongoField="_id"/>
<field column="lastUpdatedDate" sourceColName="lastUpdatedDate" dateTimeFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" locale="en"/>
</entity>
</document>
</dataConfig>
sample from managed-schema file
<field type="date" name="modifiedDate" indexed="true" stored="true"/>
<field type="date" name="lastUpdatedDate" indexed="true" stored="true"/>
the value stored in DocumentDB:
lastUpdatedDate:2019-11-24T11:43:46.045+00:00
I tried to follow the date-time format as stored in DocumentDB, but still, it did not work, also, I tried suggestions from other similar question asked here but no luck. I tried below snippet in delta query
{lastUpdatedDate : {$gt: ISODate('${dih.last_index_time}')}} , but I got JSON Prasing Excpetion
but got below Exception
java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: com.mongodb.util.JSONParseException:
{'lastUpdatedDate':{$exists:true},'lastUpdatedDate':{$gt: ISODate('2019-11-20T13:14:30.576-08:00')}}
I tried following configuration too
deltaQuery="{'lastUpdatedDate':{$exists:true},'lastUpdatedDate':{$gt:
{$date:'${dih.last_index_time}'}}}"
could someone please help me or provide any suggestions to trigger delta query
The correct way to use the deltaQuery is
deltaQuery="{'lastUpdatedDate':{$exists:true},'lastUpdatedDate':{$gt: {$date:'2020-03-13T08:44:06.959Z'}}}"
as you can see here
However, the SOLR will use ${dih.last_index_time} that is by default formated as 2020-03-13 08:44:06. You'll need to change the format by adding something like the following setting inside your <dateConfig> element.
<propertyWriter dateFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" type="SimplePropertiesWriter" filename="my_dih.properties" locale="en-US" />
Related
I need to import customers data with tags into res.partner with an XML when installing a custom module.
"Customers" data is stored in res.partner and "Tags" data is stored in res.partner.category, they have a relationship Many2many through res_partner_res_partner_category_rel.
I'm calling two XML files in the __manifest__.py:
The first one populates successfully res.partner.category:
<?xml version="1.0"?>
<odoo>
<record model="res.partner.category" id="res_partner_category_1">
<field name="name">Heavy metal</field>
<field name="active">1</field>
</record>
</odoo>
The second one inserts the partner data:
<?xml version="1.0"?>
<odoo>
<record model="res.partner" id="res_partner_predata_1">
<field name="name">Iron Maiden</field>
</record>
</odoo>
All I need is to insert this res.partner registry with the "Heavy metal" Tag with the installation of a custom module like this:
This is how it would look:
I will deeply appreciate any help.
I found the answer in the Odoo demo data:
When I created the category Heavy metal I assigned the id res_partner_predata_1, then I only have to add the next line (the one after the comment) to the res_partner registry like this:
<?xml version="1.0"?>
<odoo>
<record model="res.partner" id="res_partner_predata_1">
<field name="name">Iron Maiden</field>
<--! This line will add the category-->
<field eval="[(6, 0, [ref('module_name.res_partner_category_1')])]" name="category_id"/>
</record>
</odoo>
I faced the same question with odoo 14. In my case your solution did not work completely. Instead of:
<field eval="[(6, 0, [ref('module_name.res_partner_category_1')])]" name="category_id"/>
I had to set:
<field name="category_id" eval="[(6,0,[ref('res_partner_category_1')])]"/>
I have successfully imported several product templates into Odoo (version 8) and used External IDs for this. Now I want to import product description translations into ir.translation and want to use these External IDs. I guess, I have to put in field "Record ID" a reference to the product template - but this field unfortunately doesn't support External IDs in import screen.
How can I import translations for product templates with external IDs in an elegant way?
If I understood you well (you want to translate the field description of a product.template record which was introduced by XML code in a module you did before), you can try this and tell me if it works:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
<record id="whatever_you_want" model="ir.translation">
<field name="name">product.template,description</field>
<field name="type">model</field>
<field name="res_id" ref="the_module_which_introduced_xml_records.the_xml_id_of_the_record_you_want_to_translate"/>
<field name="lang">de_DE</field> <!-- The code of the language you want to translate to -->
<field name="src">Your product template description</field>
<field name="value">Your translation (in this case to German)</field>
</record>
</data>
</openerp>
Is there any way to create test instance with parameter using the REST API on QC 11 ?
I have a test in my test plan with some parameters, or just one for the exercise :
I want to create using the rest API :
A test set in my test lab
A test instance in this test set
A test run of my test (the one in the plan) in this test instance
And be able to set the value of my parameters
I have manage to do the first 3 points. But I can not find how to set the parameter value for my instance. If I create the tests manually it is asked during the add of the test in the instance. And I can find the parameters in the Execution Settings in the Test Instance detail :
I have search in the documentation, but didn't find anything about how to set/use theses parameters. I have made GET on every objects, but didn't find them. I also try some urls like :
/test-instances/25378/test-parameters
/test-instances/25378/execution-settings
/test-instances/25378/exec-settings
But they always return 404.
Is there any way to set these parameters values ?
I had same troubles and here is my solution.
You can query your test parameters as:
/tests/{id}/test-parameters
And your test instance parameters, which are effectively actual values for those in your test instance, with:
/test-instances/{id}/step-parameters
For parameter values created via UI it returns like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Entities TotalResults="1">
<Entity Type="step-parameter">
<ChildrenCount>
<Value>0</Value>
</ChildrenCount>
<Fields>
<Field Name="origin-test">
<Value>-1</Value>
</Field>
<Field Name="vc-user-name">
<Value></Value>
</Field>
<Field Name="id">
<Value>21</Value>
</Field>
<Field Name="parent-id">
<Value>46</Value>
</Field>
<Field Name="used-by-owner-type">
<Value>test-instance</Value>
</Field>
<Field Name="actual-value">
<Value><html><body>
<div align="left">
<font face="Arial"><span style="font-size:8pt">AAA</span></font>
</div>
</body></html></Value>
</Field>
<Field Name="key">
<Value></Value>
</Field>
<Field Name="used-by-owner-id">
<Value>34</Value>
</Field>
</Fields>
<RelatedEntities/>
</Entity>
</Entities>
Where used-by-owner-id is id of the test-instance and parent-id is id of test parameter of the test.
Actual value for this case is AAA wrapped up with html tags.
You can create step parameters like this using normal POST to url:
/step-parameters
Note: Don't use same nested url for creation as you use for retrieval. You'll not be able to create parameters with such a combination of parameters you need.
API documentation really sucks, but you can get ideas how to retrieve or create things you need by requesting entity schema with
/customization/entities
I need to add/modify fields in the FIX4.4 dictionary. I haven't found any helpful documentation or tutorials on this.
I'm guessing I have to modify the FIX44.xml file, but I'm not sure how exactly to do that.
In the <message></message> tags I don't see any attributes that define the number or the type(format) of that field. I see just the name and required attributes.
I think I found attributes I', looking for in the <fields></fields> tags.
I'm not sure if I'm looking in the right place or if I'm doing the right thing, but according to this I should modify the dictionary if it is necessary.
Please help.
A link to a tutorial for beginners that can help me would also be greatly appreciated.
The FIX Data Dictionary in QuickFIX contains Messages and Fields (among other things).
To add Messages you must add the message between the <messages></messages> tags like this:
<message name="CoolMessage" msgcat="app" msgtype="xCM">
<field name="Currency" required="N"/>
<field name="Text" required="N"/>
<field name="Account" required="Y"/>
</message>
And then add the new msgtype to the MsgType field in the <fields></fields> section like this:
<field number='35' name='MsgType' type='STRING'>
...
<value enum='xCM' description='COOLMESSAGE'/>
</field>
If you want to add new fields, just add them between the <fields></fields> tags like this:
<fields>
<field number="1" name="Account" type="STRING"/>
<field number="2" name="AdvId" type="STRING"/>
<field number="3" name="AdvRefID" type="STRING"/>
...
<field number="9006" name="AwesomeField" type="STRING"/>
</fields>
This and more information can be found in this tutorial.
I'm trying to populate a smartgwt calendar using data form a server obtained using a datasource. Unfortunately the examples in showcase only use client only test data, where one has to create an array of calendar events first. Can anyone give an example of how to do this directly from a rest datastore for example.
Thanks.
Yes, I had trouble tracking down an example too. I eventually figured it out by looking at the samples. It seems like the Calendar doesn't care about the type of the objects used by the datasource, but rather that they provide properties of name, startDate, endDate, and description. (Note that startDate and endDate should be defined as "datetime" in your ds.xml, or all of the events will be full-day events.) Here an example ds.xml (based on the sample for Google App Engine modified with a calendar object):
<DataSource
ID="Appointment_DataSource"
serverConstructor="com.isomorphic.jpa.GAEJPADataSource"
beanClassName="com.smartgwt.sample.server.Appointment"
>
<fields>
<field name="eventID" type="text" hidden="true" primaryKey="true" />
<field name="name" type="text" title="Name" required="true" />
<field name="startDate" type="datetime" title="Start Date" required="true" />
<field name="endDate" type="datetime" title="End Date" required="true" />
<field name="description" type="text" title="Description" />
</fields>
</DataSource>