xmpp/ejabberd user search commend returning empty fields - xmpp

this is my query to ejabberd server running on localhost using window telnet to search whether user exists or not
local server host name is durgesh-laptop
<iq type="set" id="searchByUserName" to="vjud.durgesh-laptop"from="durgesh#durgeshlaptop">
<query xmlns="jabber:iq:search">
<x xmlns="jabber:x:data" type="submit">
<field type="hidden" var="FROM_TYPE">
<value>jabber:iq:search</value>
</field>
<field var="user">
<value>anand</value>
</field></x></query></iq>
server response is:-
<iq from='vjud.durgesh-laptop' to='durgesh#durgesh-laptop/Telnet Client' id='searchByUserName' type='result'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='result'>
<title>Search Results for vjud.durgesh-laptop</title>
<reported><field type='text-single' label='Jabber ID' var='jid'/>
<field type='text-single' label='Full Name' var='fn'/>
<field type='text-single' label='Name' var='first'/>
<field type='text-single' label='Middle Name' var='middle'/>
<field type='text-single' label='Family Name' var='last'/>
<field type='text-single' label='Nickname' var='nick'/>
<field type='text-single' label='Birthday' var='bday'/>
<field type='text-single' label='Country' var='ctry'/>
<field type='text-single' label='City' var='locality'/>
<field type='text-single' label='Email' var='email'/>
<field type='text-single' label='Organization Name' var='orgname'/>
<field type='text-single' label='Organization Unit' var='orgunit'/></reported></x>
</query></iq>
it contain empty fields. No matter whether user exists or not it always response with empty field values
please tell me where i am doing wrong.

Related

Incorrect NumInGroup count for repeating group (Field=268)

When I recieve a Market Data Snapshot Full Refresh message, my app cannot consume it.
This is how the message looks like:
8=FIX.4.4|9=160|35=W|34=1625|49=DummyBroker|56=DummyID|52=20220201-15:17:17.201806|262=43_MarketDataChange|55=USD/CHF|268=6|269=0|270=0.92282|271=400000|269=1|270=0.92293|271=400000|10=227|
Human readable format (please ignore the Invalid lines):
Error message my app is sending back to the server: Rejected: Incorrect NumInGroup count for repeating group (Field=268)
268=6 seems ok to me, so I am guessing that something is wrong with the DataDictionary.
This is how the message appears in my DataDictionary:
<message name="MarketDataSnapshotFullRefresh" msgtype="W" msgcat="app">
<field name="MDReqID" required="N"/>
<field name="Symbol" required="Y"/>
<group name="NoMDEntries" required="Y">
<field name="MDEntryType" required="Y"/>
<field name="MDEntryPx" required="Y"/>
<field name="MDEntrySize" required="Y"/>
</group>
</message>
Relevant fields:
<field number="268" name="NoMDEntries" type="NUMINGROUP"/>
<field number="269" name="MDEntryType" type="CHAR">
<value enum="0" description="BID" />
<value enum="1" description="OFFER" />
</field>
<field number="270" name="MDEntryPx" type="PRICE"/>
<field number="271" name="MDEntrySize" type="QTY"/>
In my config file ValidateFieldsHaveValues=N, ValidateFieldsOutOfOrder=N.
Anyone knows where the issue is?
As #ChristophJohn mentioned NoMDEntries should be 2 not 6, so the error is on the broker side.
It was already explained here:
what is "NoMDEntries"?
The correct message should look like this:
8=FIX.4.4|9=160|35=W|34=1625|49=DummyBroker|56=DummyID|52=20220201-15:17:17.201806|262=43_MarketDataChange|55=USD/CHF|268=2|269=0|270=0.92282|271=400000|269=1|270=0.92293|271=400000|10=227|

Jabber Search for advanced user search

I'm trying to search user by username in my xmpp server, but the result always contains no items...
for getting the form format I send:
<iq type='get' to='search.MY_SERVER' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'/>
</iq>
and received:
<iq xmlns="jabber:client" type="result" id="3:sendIQ" from="search.MY_SERVER" to="ID#MY_SERVER/7acf23bb">
<query xmlns="jabber:iq:search">
<instructions>The following fields are available for searching. Wildcard (*) characters are allowed as part of the query.</instructions>
<first/><last/><nick/><email/>
<x xmlns="jabber:x:data" type="form">
<title>Advanced User Search</title>
<instructions>The following fields are available for searching. Wildcard (*) characters are allowed as part of the query.</instructions>
<field var="FORM_TYPE" type="hidden">
<value>jabber:iq:search</value>
</field>
<field var="search" type="text-single" label="Search">
<required/>
</field>
<field var="Username" type="boolean" label="Username">
<value>1</value>
</field>
<field var="Name" type="boolean" label="Name">
<value>1</value>
</field>
<field var="Email" type="boolean" label="Email">
<value>1</value>
</field>
</x>
</query>
</iq>
and then I send:
<iq type='set' to='search.MY_SERVER' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field type='hidden' var='FORM_TYPE'>
<value>jabber:iq:search</value>
</field>
<field var='search'>
<value>*</value>
</field>
</x>
</query>
</iq>
but received no items:
<iq xmlns="jabber:client" type="result" id="4:sendIQ" from="search.MY_SERVER" to="ID#MY_SERVER/7acf23bb">
<query xmlns="jabber:iq:search">
<x xmlns="jabber:x:data" type="result">
<field var="FORM_TYPE" type="hidden"/>
<reported>
<field var="jid" type="jid-single" label="JID"/>
<field var="Username" type="text-single" label="Username"/>
<field var="Name" type="text-single" label="Name"/>
<field var="Email" type="text-single" label="Email"/>
</reported>
</x>
</query>
</iq>
Does someone know what went wrong?
I have found the answer,send following request will do the trick:
<iq type='set' to='search.MY_SERVER' xmlns='jabber:client'>
<query xmlns='jabber:iq:search'>
<x xmlns='jabber:x:data' type='submit'>
<field var='search'>
<value>SEARCH_CRITERIA</value>
</field>
<field var='Username'>
<value>1</value>
</field>
</x>
</query>
</iq>

how to create wizard to copy an object many time?

I am beginner in OpenERP, I want to create a wizard to duplicate an object many time, which when i click on the button the wizard open a form the content if this form it's ( textbox + ok button) the textBox for to write how many time the wizard will call copy function to copy the object
This is my class
class immo_article(osv.osv):
_name = "immo.article"
_description = "immo article"
_columns = {
'name':fields.integer('N d inventaire',required=True , size=10),
}
_defaults = {
'date_creation': fields.date.context_today,
}
immo_article()
and this my view
<record id="immo_article_form" model="ir.ui.view">
<field name="name">immo.article.form</field>
<field name="model">immo.article</field>
<field name="arch" type="xml">
<form string="article" >
<button string="%(action_duplicate_object)d" type="action" name="duplicate.wiz"/>
<field name="name" />
</form>
</field>
</record>
<record id="immo_article_tree" model="ir.ui.view">
<record id="immo_article_tree" model="ir.ui.view">
<field name="name">immo.article.tree</field>
<field name="model">immo.article</field>
<field name="arch" type="xml">
<tree string="articles">
<field name="name" />
</tree>
</field>
</record>
<record id="immo_article_form_act" model="ir.actions.act_window">
<field name="name">Article</field>
<field name="res_model">immo.article</field>
<field name="view_mode">tree,form</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_id" ref="immo_article_tree"/>
<field name="help" type="html"></field>
</record>
and this my wizard .py
class duplicate_wiz(osv.osv_memory):
_name = 'duplicate.wiz'
_description = 'duplicate wizard'
_columns = {
'number_of_copies':fields.integer('Number of copies', size=2 , required=True),
}
_defaults = {
'number_of_copies': '0',
}
def duplicate_object(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids)[0]
article_id = context['active_id']
try:
number_of_copies = data['number_of_copies']
except:
raise osv.except_osv(_('Error'), _('Trouble!'))
return {'type': 'ir.actions.act_window_close'}
duplicate_wiz()
and this my wizard view
<record id="dup_view" model="ir.ui.view">
<field name="name">duplicate.wizard</field>
<field name="model">duplicate.wiz</field>
<field name="priority">1</field>
<field name="arch" type="xml">
<form string="Duplicate" version="7.0">
<group col="2">
<field name="number_of_copies"/>
</group>
<footer>
<button name="duplicate_object" string="_Import" type="action" class="oe_highlight"/>
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_duplicate_object" model="ir.actions.act_window">
<field name="name">duplicater action</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">duplicate.wiz</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="view_id" ref="dup_view"/>
</record>
</data>
I know I have many errors in wizard code, because I don't know how to it and how I can call the wizard from the button, anyone can help me with this ?
I don't have time now to read all your code, but the button on immo.article.form should have action reference in name attribute, not in string:
<button name="%(action_duplicate_object)d" type="action" string="A string"/>

Execute QTP TestSet from REST

Does anyone have an xml block that will kick off a testset (curl example would be great)?
The REST documentation in HP-ALM does not show how to execute a testset from REST. There is a description of how to create a defect. The secondary problem is that the docs suggest that required fields include cycle_id and testcycl_id for which I can't find a way to get their values.
Specifically - I want to create a Run object via POST
thanks
ALM REST API Does not have the feature to kickoff Automated tests. We need to go with OTA API for the same.
By OTA try this code in VBS.
Set tdc = CreateObject("TDAPIOLE80.TDConnection")
tdc.InitConnectionEx "https://URLALM"
tdc.login "USer", "pass"
tdc.Connect "DOMAIN", "PROJECT"
Set objShell = CreateObject("WScript.Shell")
'Set TSetFact = tdc.TestSetFactory
Set tsTreeMgr = tdc.TestSetTreeManager
Set tsFolder = tsTreeMgr.NodeByPath("your tree")
Set tsList = tsFolder.FindTestSets("testSet")
Set theTestSet = tsList.Item(1) 'list of testSets
Set Scheduler = theTestSet.StartExecution("")
if err.number <> 0 then
'msgbox err.Description
Else
Scheduler.RunAllLocally = True
Scheduler.Run
Set execstatus = Scheduler.ExecutionStatus
Do While RunFinished = False
execstatus.RefreshExecStatusInfo "all", True
RunFinished = execstatus.Finished
Set EventsList = execstatus.EventsList
For Each ExecEventInfoObj In EventsList
strNowEvent = ExecEventInfoObj.EventType
Next
For i = 1 To execstatus.Count
Set TestExecStatusobj = execstatus.Item(i)
intTestid = TestExecStatusobj.TestInstance
Next
Loop
execstatus.RefreshExecStatusInfo "all", True
End if
Set tsTreeMgr = nothing
Set tsFolder = nothing
Set tsList = nothing
Set theTestSet =nothing
tdc.Disconnect
tdc.Logout
tdc.ReleaseConnection
Set tdc = Nothing
Through Rest Api,You can create run for each of the test instance in a test set and update each of the step through run-steps of that particular test case while execution.
While creating the run you have update following mandatory field:-
http://<server>/qcbin//rest/domains/<>/projects/<>/runs/
<Entity Type=\"run\"><Fields>
<Field Name=\"name\"><Value>Run_2015-04-15</Value></Field>
<Field Name=\"testcycl-id\"><Value>573269</Value></Field>
<Field Name=\"cycle-id\"><Value>4363</Value></Field>
<Field Name=\"test-id\"><Value>29201</Value></Field>
<Field Name=\"subtype-id\"><Value>hp.qc.run.MANUAL</Value></Field>
<Field Name=\"owner\"><Value>owner</Value></Field>
</Fields></Entity>
After creating run ,you need to fetch Run-ID{Run ID} from the generated Response Xml
/qcbin/rest/domains/{domain}/projects/{project}/runs/?query={name[Run_2015-04-15]}-use this url to get {Run ID}
will be used to update steps.Used in following Url
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/
For run-steps:-
To get the ID for the particular Step (like Step 1,2...).Use following query url.
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/?query={name[Step 1]}-use this url to get Step ID {ID}.
To Update Step:-
1. Use following url:-
/qcbin/rest/domains/{domain}/projects/{project}/runs/{Run ID}/run-steps/{ID}
2.Generate the Xml and use post method to update status field.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <Entity Type="run-step">
+ <ChildrenCount>
<Value>0</Value>
</ChildrenCount>
- <Fields>
+ <Field Name="test-id">
<Value>6</Value>
</Field>
+ <Field Name="comp-status">
<Value />
</Field>
<Field Name="rel-obj-id" />
<Field Name="obj-id" />
+ <Field Name="has-linkage">
<Value>N</Value>
</Field>
+ <Field Name="execution-date">
<Value>2017-09-25</Value>
</Field>
+ <Field Name="path">
<Value />
</Field>
+ <Field Name="desstep-id">
<Value>1031</Value>
</Field>
+ <Field Name="attachment">
<Value>Y</Value>
</Field>
+ <Field Name="has-picture">
<Value>N</Value>
</Field>
<Field Name="tree-parent-id" />
+ <Field Name="id">
<Value>24820</Value>
</Field>
+ <Field Name="component-data">
<Value />
</Field>
+ <Field Name="bpt-path">
<Value />
</Field>
+ <Field Name="actual">
<Value><html><body> Results match expected </body></html></Value>
</Field>
+ <Field Name="step-order">
<Value>1</Value>
</Field>
<Field Name="level" />
+ <Field Name="expected">
<Value><html><body> <div align="left"> <font face="Arial"><span style="font-size:8pt">Successful launch of website</span></font> </div> </body></html></Value>
</Field>
<Field Name="line-no" />
+ <Field Name="comp-subtype-name">
<Value />
</Field>
- <Field Name="extended-reference">
<Value />
</Field>
- <Field Name="name">
<Value>Step 1</Value>
</Field>
+ <Field Name="execution-time">
<Value>03:56:29</Value>
</Field>
+ <Field Name="bpta-condition">
<Value />
</Field>
+ <Field Name="user-template-01">
<Value>Website Tester</Value>
</Field>
+ <Field Name="parent-id">
<Value>1522</Value>
</Field>
+ <Field Name="user-template-03">
<Value />
</Field>
+ <Field Name="bpt-facet-type">
<Value />
</Field>
+ <Field Name="user-template-04">
<Value>kama</Value>
</Field>
- <Field Name="status">
<Value>Passed</Value>
</Field>
</Fields>

get offline messages of publisher

I have implemented XEP-0060 pubsub using openfire , i am able to publish messages over an existing node and i have other subscribers who can get those published messages.
now the issue is , i am not be able to receiver the old messages i mean if the subscribers are offline and when they come back online then how can i get the old messages which were being published by the publisher long time back.
My node on which publishers are publishing is configured as follows
<iq from="pubsub.example.com" type="result" id="meta1" to="lime#example.com/localhost">
<query xmlns="http://jabber.org/protocol/disco#info" node="mynode/loc">
<identity category="pubsub" type="leaf"/>
<feature var="http://jabber.org/protocol/pubsub"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<x xmlns="jabber:x:data" type="result">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field type="text-single" label="Short name for the node" var="pubsub#title">
<value/>
</field>
<field type="text-single" label="Description of the node" var="pubsub#description">
<value/>
</field>
<field type="boolean" label="Allow subscriptions to node" var="pubsub#subscribe">
<value>1</value>
</field>
<field type="boolean" label="New subscriptions require configuration" var="pubsub#subscription_required">
<value>0</value>
</field>
<field type="boolean" label="Deliver payloads with event notifications" var="pubsub#deliver_payloads">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when the node configuration changes" var="pubsub#notify_config">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when the node is deleted" var="pubsub#notify_delete">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when items are removed from the node" var="pubsub#notify_retract">
<value>1</value>
</field>
<field type="boolean" label="Only deliver notifications to available users" var="pubsub#presence_based_delivery">
<value>0</value>
</field>
<field type="text-single" label="Type of payload data to be provided at this node" var="pubsub#type">
<value/>
</field>
<field type="text-single" label="Message body XSLT" var="pubsub#body_xslt">
<value/>
</field>
<field type="text-single" label="Payload XSLT" var="pubsub#dataform_xslt">
<value/>
</field>
<field type="list-single" label="Specify who may subscribe and retrieve items" var="pubsub#access_model">
<option>
<value>authorize</value>
</option>
<option>
<value>open</value>
</option>
<option>
<value>presence</value>
</option>
<option>
<value>roster</value>
</option>
<option>
<value>whitelist</value>
</option>
<value>open</value>
</field>
<field type="list-single" label="Publisher model" var="pubsub#publish_model">
<option>
<value>publishers</value>
</option>
<option>
<value>subscribers</value>
</option>
<option>
<value>open</value>
</option>
<value>open</value>
</field>
<field type="list-multi" label="Roster groups allowed to subscribe" var="pubsub#roster_groups_allowed"/>
<field type="jid-multi" label="People to contact with questions" var="pubsub#contact"/>
<field type="text-single" label="Default language" var="pubsub#language">
<value>English</value>
</field>
<field type="jid-multi" label="Node owners" var="pubsub#owner">
<value>mypublisher#example.com</value>
</field>
<field type="jid-multi" label="Node publishers" var="pubsub#publisher"/>
<field type="list-single" label="Select entity that should receive replies to items" var="pubsub#itemreply">
<value>owner</value>
</field>
<field type="jid-multi" label="Multi-user chat room to which replies should be sent" var="pubsub#replyroom"/>
<field type="jid-multi" label="Users to which replies should be sent" var="pubsub#replyto"/>
<field type="boolean" label="Send items to new subscribers" var="pubsub#send_item_subscribe">
<value>1</value>
</field>
<field type="boolean" label="Persist items to storage" var="pubsub#persist_items">
<value>1</value>
</field>
<field type="text-single" label="Max number of items to persist" var="pubsub#max_items">
<value>5</value>
</field>
<field type="text-single" label="Max payload size in bytes" var="pubsub#max_payload_size">
<value>5120</value>
</field>
</x>
</query>
</iq>
yeah i got it , when the subscriber gets online using following stanza he/she can retrive the old published items
subid is must in this case
<iq type='get'
from='subscriber#example.com'
to='pubsub.example.com'
id='items1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='mynode'
subid="8839399494949"/>
</pubsub>
</iq>