I am not able to find a way (even with Mango SDK) in which I can show a chooser (say PhoneNumberChooserTask), and get all details about a contact...
Only Name and PhoneNumber is available. For other information like address, I have to use a different chooser. Is there any way in which I can show a chooser (anyone) and get all details...
Phone number
Email address
Photo of the contact
etc.
let me clarify the issue here...
The following code will not work. I want to show a chooser in such a way that it grabs all details. Showing multiple choosers, as I said is not what I want. Imagine asking someone to choose the same contact 3 times to get Email, PhoneNumber and Address.
EmailAddressChooserTask ect = new EmailAddressChooserTask();
ect.Completed += new EventHandler<EmailResult>(ect_Completed);
ect.Show();
PhoneNumberChooserTask pct = new PhoneNumberChooserTask();
pct.Completed += new EventHandler<PhoneNumberResult>(pct_Completed);
pct.Show();
AddressChooserTask act = new AddressChooserTask();
act.Completed += new EventHandler<AddressResult>(act_Completed);
act.Show();
In v7.1 (Mango) you can use the Contacts class. You can use the SearchAsync method providing whatever search criteria you want (DisplayName is the most likely) and then handle the SearchCompleted event and use the ContactsSearchEventArgs.Results to access the returned Contact objects.
From there, you can use the GetPicture method to retrieve the contact image, and the various properties of the Contact object to access all the other information.
Hopefully that will get you started. You can find more information in the Microsoft.Phone.UserData namespace.
I think you can do this with the following tasks:
AddressChooserTask
EmailAddressChooserTask
PhoneNumberChooserTask
Related
I am developing a Mozilla Thunderbird plug-in and need to get the user's email address.
Question: How do I retrieve this address?
I will use it inside a JavaScript.
You should first keep in mind that a user can have multiple e-mail addresses (from multiple accounts or even multiple identities for one account), and you have to decide in which one you are interested.
Note: there may exist an easier way then described below, e.g. a helper function in the existing Thunderbird Code. You could try to search comm-central for it
You somehow have to get the nsIMsgIdentity for the identity you are interested in. It has an email property, with the e-mail adress as a string.
One way to get all Identities should be via the allIdentities of nsIMsgAccountManager (didn't test it).
Use the follwing code to get the nsIMsgAccountManager:
Components.utils.import("resource:///modules/mailServices.js");
let accountManager = MailServices.accounts
If you have an nsIArray of nsIMsgIdentity, you can use the following code to loop over them:
for (let identity in fixIterator(identities, Components.interfaces.nsIMsgIdentity)) {
}
References which could be useful:
Overview of some interesting interfaces:
https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Account_interfaces
Some account example Code:
https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Account_examples
I want to filter records on my browse screen with email of current user.I used Office 365 Users Connection.
Logic Which I have written on items property of browse screen:
SortByColumns(Search(Filter('Time Entries', User().Email= Office365Users.MyProfile().Mail) , TextSearchBox1.Text, "cf_name"), "createdon", If(SortDescending1, Ascending,Descending))
Error:
Part of this filter cannot be evaluated remotely due to service limitations.The local evaluation may produce suboptimal or partial results.
Try changing the Onstart of your app to Set(CurrentUser,User()) and then instead of User().Email = Office365Users.Myprofile().Mail use CurrentUser.Email = Office365Users.Myprofile()
I need to create a User-Specific content page, I have registered users and I need to create a module/page/menu/feed or whatever that displays articles that are for only one or some users.
For example, in my site, I show to public some projects (articles redacted as some architecturing project) for example: news, finished projects, etc, some people register and can access to other content that is intended for registered users, for example: new projects that only registered clients would be interested, so far, I managed to make this work, but now, I have work that is for a specific user and he/she only can see it in his/her feed, for example: status of their project made by us, some galleries with photos of the work in progress, etc.
So, This feed must be a module/page/menu that shows articles with a specific category and for registered users. But I want to be able to post an article that is only intended for a specific user or a set of users and shows in this feed (module) or at least a whole new module that shows user-specific content without having to create a category and an access level for each user.
Is there an extension or plug-in that helps me do this?
you need to make do two things:
Make a new user-group (Users->User group) as a sub-group of
registered. Add the users that need the special permission to this
group.
Make a new access-level (Users->access-levels) and add you
new user-group to this access level
Set the access-level on the article(s) that you want to restrict access on.
The module should check the access-level before it displays it to the users, and only display the restricted articles to those that have the correct privileges.
The system don't really support what you ask for, but you could use the following setup:
Make a content-plugin (http://docs.joomla.org/J2.5:Creating_a_content_plugin). In the event onContentPrepareForm, you modify the created_by_alias-field to use it for your special user allowed to view this content article.
function onContentPrepareForm($form, $data){
// first check that context is right
// Then change the type of the field. This should allow to select
// the user when you create the article.
$form->getField('created_by_alias')->__set('type', 'user');
}
In the event onContentPrepareData, check if the data in the created_by_alias references a valid user in the user group your users shoud be in
public function onContentPrepare($context, $article, $params, $page){
// first check that context is right
//Then fetch the user data:
if(is_int($article->created_by_alias)){ // ( Optionally check if the article is in a specific category )
$db=JFactory::getDbo();
$currentuser=JFactory::getUser();
$allowedgroup=2; // the registered users group
$sql="select u.id from #__users inner join #__user_usergroup_map ug (u.id=ug.user_id) where ug.group_id={$allowedgroup}";
$db->setQuery($sql);
$user=$db->loadObject();
if($user->id==$currentuser){
$data->user=$user;
}
else{
//Unset the article content to prevent unothorized users from seeing the content.
unset($article);
}
}
Finally, create a module (http://docs.joomla.org/Creating_a_simple_module) that feeds articles for a particular user, containing at least:
$list=array();
$user=Jfactory::getUser();
if($user->id>0){
$sql="select * from #__content where created_by_alias={$user->id}";
// ( also add sql to check that the user has access,
// the article is published, the correct category etc)
$db=Jfactory::getDbo();
$db->setQuery($sql);
$list=$db->loadObjectList();
if(!count($list)) return;
}
else return;
print_r($list); // Prints the content articles
This scheme should protect unauthorized users from viewing the content of the articles ment for a specific user. The module should (after nicely outputting what you want to display) display a list of articles for the logged inn user. The module can link to the article in the normal way, and the authorized user will have access. So it should be "safe enough", and provide the functionality you need without too much hassle.
I'll try anotherone here:
You could just install a messageing system on your site. UddeIM is one such system. This will allow you to make specific content for your users. UddeIM can be configured so only administrators can send messages. There is also some modules for this component to show latest messages etc.
I need to get certain details for a user by his AD login ID.
Remember I just don't want to look into that user's contacts only. I want to look in global list and find the details (Similar details is shown when you double click the name of the person in the email message from, to, cc )
I found lot of links out there but they don't show any example for global search of user.
I tried to do something similar shown in this link
http://msdn.microsoft.com/en-us/library/jj220498(v=exchg.80).aspx
however it just within my own contacts.
Can anybody show a simple example or link for the same?
I found that ResolveName method does the trick. I can query by user's full name. I am just posting a method. I assume 'service' is already instantiated using proper domain/url/credentials
public Contact GetContactInfo(string sFullName)
{
Contact contact = null;
try
{
NameResolutionCollection allContacts = service.ResolveName(sFullName, ResolveNameSearchLocation.DirectoryOnly, true);
if (allContacts.Any())
{
contact = allContacts[0].Contact;
}
}
catch (Exception ex)
{
LogHelper.Error("Error in GetContactInfo(): ", ex);
//throw;
}
return contact;
}
Have you tried the ResolveName method?
http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.exchangeservice.resolvename%28v=exchg.80%29.aspx
You can search the contacts folder and/or global address list with it. Make sure you set the boolean value to return the Contact with it.
I was looking for user's details and GetPersona is the operation.
Sharing with the concern that it may help others who are digging google & Microsoft to get user's information.
GetPersona operation
The GetPersona operation returns a set of properties that are associated with a persona.
Should be an easy-to-find info, but I wasn't able to find any doc page explaining what the DHL module can do and what cannot. Specifically:
can automatically create the shipment? (I mean, in such a way that whenever an order is placed - w-and ithout any action by me - someone at DHL will be notified that there's a box to be picked up at my company to be shipped...)
can automatically create the tracking number and send it - via email - to the customer
or all it can do is just getting quotes?
No, and No. What it does do is allow for you to get, display, and record rates for the various shipping options.