How to get all fields from ejabberd from MUC module? - ejabberd

We want to get all fields from this link (http://xmpp.org/extensions/xep-0045.html#roomconfig) for this section
Example 165. Service Sends Configuration Form to Owner
In the specification it is showing all fields, but we are not getting all fields from ejabberd like:
<field label='Roles and Affiliations that May Retrieve Member List' type='list-multi' var='muc#roomconfig_getmemberlist'>
We want to get muc#roomconfig_getmemberlist, but it is not getting from ejabberd.
What config we need to change to get all field like above link?

ejabberd is return all the field it supports. At the moment ejabberd does not support changing the affiliation of users allowed to retrieve the member list. It is assumed, that MUC admin, room owner and members can retrieve the member list.
That said, even if you do not have that field in the configuration form, ejabberd supports managing member list.
You can retrieve the members list from a user with proper credentials, sending the following query:
<iq type="get" to="room#conference.example.net" id="aac1a">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item affiliation="member"/>
</query>
</iq>
You will receive a reply of the form:
<iq from="room#conference.example.net" type="result" id="aae0a">
<query xmlns="http://jabber.org/protocol/muc#admin">
<item affiliation="member" jid="newmember#example.net"/>
</query>
</iq>

Related

agsXMPP, Create muc room "Only occupants are allowed to send messages to the conference"

I need help with agsXMPP
user (testz2#mx.testserverz.info) authorization is successful
the user testz2#mx.testserverz.info created muc room (group chat)
testconfa#conference.mx.testserverz.info
3.the user testz2#mx.testserverz.info send request to invite another user to this room,
but server return message
<message xmlns="jabber:client" from="testconfa#conference.mx.testserverz.info" to="testz2#mx.testserverz.info/agsXMPP" type="error" xml:lang="en">
<error type="modify" code="406">
<not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" xml:lang="en">Only occupants are allowed to send messages to the conference</text>
</error>
<body>Hi everybody...</body>
</message>
how can the creator of a room become a member of a room and invite another user to this room ?
how can the creator of a room become a member of a room and invite another user to this room ?
No, no need for the user to be a room member , that is an affiliation: https://xmpp.org/extensions/xep-0045.html#affil
What you want is the user to be a room occupant, which means that the user joins/enters the room.
If the user sends a Mediated Invitation, he must be a room occupant when sending the invitation, as mentioned in: https://xmpp.org/extensions/xep-0045.html#invite
So, the user must join/enter the room he created: https://xmpp.org/extensions/xep-0045.html#enter and then he can send the invitation.
And what's the code to implement client joining a room in the library you are using? Sorry, I don't know that library.

Handle Xmpp group in objc

I have created room with XMPPFramework in objc .. I created it successfully but when I m going to offline that time room was destroy. I also no idea where I should place invite function to add user in group (room). please sort out for me.
It's destroyed probably because you created a temporary room, which is destroyed after last occupant left it.
XMPP rooms can be persistent vs. temporary
Here is a XEP-0045 config on how to handle it
<field
label='Make Room Persistent?'
type='boolean'
var='muc#roomconfig_persistentroom'>
<value>1</value>
</field>
https://xmpp.org/extensions/xep-0045.html#registrar-formtype-owner

Is there any Mql command to print the connection between two admin objects?

In Enovia Mql, if we want to print the details of a connection between a person and its company object what is the command. For Ex: Business objects can be explored using "Expand", similarly what is the way for Admin Objects?
I think we need some clarification on question as when you talk about "connection between a person and its company object" that means you are talking about business objects.
But for admin objects query is different.
I will try to answer both the questions.
A. Admin object query
print person PERSONNAME;
B. Business object information:
as you need all connection information below query will help you.
expand bus Person PERSONNAME - type Company select rel id attribute.value;
as we have mentioned "type Company" the expand will only consider connected Company type of objects.
"select rel" clause selects information from relationships.
You can add any selectable for relationship in above query.
also for more information on expand you can use following query in mql and check expand bus section.
help bus;
Please try to perform below query:
Print person XYZ selectable;
Thanks_Sachin
May be it would be good if you have mentioned specific admin object names.
As per current schema design admin objects are not connected in the way business object are connected. But admin objects are referenced/added to another admin object.
For example Attribute admin object is added to type object.
print type Part select attribute
Similarly type admin object is added into policy admin object.
Print policy Engineering selet type store format;
In above example we can see type ,store and format admin objects being referenced from policy.
Similar way each admin object is referenced/added to another admin object

Re-use web service response across datasets or subreports

I'm using a web service as my XML datasource which returns entities including multiple hierarchical data like below (codes modified for project privacy);
public class UserData {
// some scalar properties
public string Id ...
public string Name ...
public string Surname ...
// some navigational properties
public Address address ...
public CourseInfo[] courses ...
public AwardInfo[] awards ...
}
To show all the entity information inside the same report, I can create different datasets in my report to call my web service and filter preferred parts of the returned service response.
To get only UserData properties:
<Query>
<Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
<SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
<ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData</ElementPath>
</Query>
To get Address information together with UserData properties:
<Query>
<Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
<SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
<ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData/Address</ElementPath>
</Query>
To get course information together with UserData properties:
<Query>
<Method Name="GetUserData" Namespace="UserApp.ReportingServices"/>
<SoapAction>UserApp.ReportingServices/IReportingService/GetUserData</SoapAction>
<ElementPath IgnoreNamespaces="true">GetUserDataResponse{}/UserData/Courses/CourseInfo</ElementPath>
</Query>
My question raises right here: If I use multiple dataset queries like above, my report will make a web service call for every dataset it has though my service always returns the same XML response which includes all the data needed for the three datasets above.
Is there any way to re-use returned XML response of a query for the other datasets? If it would possible, my report would call the web service only one time, and datasets would filter different parts of that XML response without calling the web service again and again.
If this is not possible, than what's the best practice about showing multiple hierarchical data inside the same report? Do I have to create different web services returning different hierarchical parts of the data?
Reporting Services datasets are limited to a simple table of rows and columns - they can't handle data with multiple hierarchies as you have described.
I would redesign your web service to reflect this, probably splitting it into the three sets of data you described. Then there will be three web service calls, but without the duplication of content. They will also be executed in parallel which will probably be more efficient overall than your current design.

How to get the identity of the user who ran a report?

When executing a report in MSCRM 2011, you have two options for the data sources : either SQL or Fetch.
In SSRS execution logs, the user who ran the report is always the service account.
When using fetch, in the report execution log, there is a parameter CRM_FullName containing the full name of the user who ran the report.
When using SQL source, there is no CRM_FullName parameter. How can I know who ran the report? There must be a way to know, since the Filtered views know who I am.
There is actually no way to find this information. When you create a report for MSCRM, you use a connector called "MSCRM Data Connector". This can be seen in the AdditionnalInfo column of the ExecutionLogs3 view on the SSRS instance. When using this connector and trying to show a report, you will get prompted for username and password. That's where things get interesting.
The report is not actually expecting a username/password! In fact, it expects to receive the systemuserid (guid) as username and the organizationid (guid) as password. It then search in the MSCRM_CONFIG database for the organization database settings. Then, it goes into the organization database and simply do a set context_info SYSTEMUSERID. Finally, the filteredviews are calling a function named '[dbo].[fn_FindUserGuid]' that retrieves the context_info. That is how the filtered views are properly working, while connected as the service account.
As you might have expected, we can't know the user who ran the report because the username and password prompts in SSRS are never logged anywhere (for security matters, perhaps).
The best option that I have found to log who ran a report is to actually create a stored procedure that will make a select statement on the filtered views (or any tables, as it is) and then log into a separate table the statement, the procedure parameters and the context_info(). Then, in SSRS I call that function instead of going to the filtered views directly.
Answer edited to include the getting the user fullname if sql source is used.
Register a parameter, UserID, with default value as
=User!UserID
Use the following query in your dataset
SELECT DomainName, FullName
FROM SystemUserBase
WHERE (DomainName = #UserID)
Then use
=Fields!FullName.Value
in your report.
In the CRM the user data is stored in the SystemUserBase table, and the DomainName column is the actual Domain\Username stored in User!UserID of the report.
If you prefer using views, use FilteredSystemUser view instead of SystemUserBase table.
For fetchxml try the following:
The operator operator='eq-userid' means equal to the current user.
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='true'>
<entity name='team'>
<attribute name='name' />
<attribute name='businessunitid' />
<attribute name='teamid' />
<order attribute='name' descending='false' />
<link-entity name='teammembership' from='teamid' to='teamid' visible='false' intersect='true'>
<link-entity name='systemuser' from='systemuserid' to='systemuserid' alias='user'>
<attribute name='fullname' />
<attribute name='systemuserid'/>
<filter type='and'>
<condition attribute='systemuserid' operator='eq-userid' />
</filter>
</link-entity>
</link-entity>
</entity>
</fetch>
Then in your report you can use the following code in an expression to get the users fullname
=First(Fields!user_fullname.Value, "GetUserData")
where the dataset is called GetUserData
Will the user login name suffice? i.e. can you just use something like
="Generated by " & User!UserID ?